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

API for the Grove LED. More...

Detailed Description

UPM module for the Grove LED (or other similar light-emitting diodes). An LED is a small lightbulb that emits light in response to a small current. The longer wire of an LED connects to the positive seat (anode); the shorter wire connects to the negative seat (cathode). The flat side of the bulb corresponds to the cathode, while the rounded side corresponds to the anode.

for (int i = 0; i < 10; ++i) {
led.on();
Thread.sleep(1000);
led.off();
Thread.sleep(1000);
}
led.delete();
groveled.jpg

Public Member Functions

synchronized void delete ()
 
 GroveLed (int pin)
 
int write (int value)
 
int off ()
 
int on ()
 
- Public Member Functions inherited from Grove
synchronized void delete ()
 
String name ()
 

Constructor & Destructor Documentation

GroveLed ( int  pin)

Grove LED constructor

Parameters
gpioPin to use

Member Function Documentation

int off ( )

Turns the LED off

Returns
0 if successful, non-zero otherwise
int on ( )

Turns the LED on

Returns
0 if successful, non-zero otherwise
int write ( int  value)

Turns the LED on or off, depending on the value. If the value is positive (greater than or equal to 1), the LED is turned on. Otherwise, for 0 or negative values, the LED is turned off.

Parameters
valueTells the LED to turn on (for values >=1) or off (for values <1)
Returns
0 if successful, non-zero otherwise
Inheritance diagram for GroveLed:
Inheritance graph
[legend]
Collaboration diagram for GroveLed:
Collaboration graph
[legend]

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