upm  0.4.1
Sensor/Actuator repository for libmraa (v0.8.0)
Public Member Functions | List of all members

API for MY9221-based LED Bars. More...

Detailed Description

This module defines the MY9221 interface for libmy9221

my9221.jpg
// Instantiate a Grove LED Bar, with Data pin D8 and Clock pin D9
upm_my9221.MY9221 bar = new upm_my9221.MY9221((short) 8, (short) 9);
while (true) {
for (short idx = 1; idx < 11; idx++) {
bar.setBarLevel(idx);
Thread.sleep(100);
}
}

Public Member Functions

synchronized void delete ()
 
 MY9221 (short di, short dcki)
 
int setBarLevel (short level, boolean direction)
 
int setBarLevel (short level)
 
String name ()
 

Constructor & Destructor Documentation

MY9221 ( short  di,
short  dcki 
)

Instantiates an MY9221 object

Parameters
diData pin
dckiClock pin

Member Function Documentation

String name ( )

Returns the name of the component

int setBarLevel ( short  level,
boolean  direction 
)

Sets the bar level

Parameters
levelSelected level for the bar (1 - 10)
directionUp or down; up is true and default

The documentation for this class was generated from the following file: