UPM

The UPM API is a high level sensor library for IoT devices using MRAA. See examples here. Back to index page.
SparkFun sensor images provided under CC BY-NC-SA-3.0.

GroveLed Class

Module: grove
  • ID: groveled
  • Name: LED
  • Category: led
  • Manufacturer: seeed
  • Connection: gpio
  • Kit: gsk

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.
groveled.jpg

Item Index

Methods

Methods

GroveLed

(
  • pin
)
Number

Grove LED constructor

Parameters:

  • pin Number

    Pin to use

Returns:

Number:

write

(
  • value
)
Mraa_result_t

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:

  • value Number

    Tells the LED to turn on (for values >=1) or off (for values <1)

Returns:

Mraa_result_t:

0 if successful, non-zero otherwise

off

() Mraa_result_t

Turns the LED off

Returns:

Mraa_result_t:

0 if successful, non-zero otherwise

on

() Mraa_result_t

Turns the LED on

Returns:

Mraa_result_t:

0 if successful, non-zero otherwise