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.

GroveLEDBar Class

Module: my9221

This is a 10-segment LED bar, with 8 green segments, 1 yellow segment, and one red segment. They can be daisy chained together so that this module can control multiple LED bars.
my9221.jpg

Item Index

Methods

GroveLEDBar

(
  • dataPin
  • clockPin
  • instances
)
Number

Instantiates an GroveLEDBar object

Parameters:

  • dataPin Number

    Data pin

  • clockPin Number

    Clock pin

  • instances Number

    Number of daisy-chained Grove LED Bars, default 1

Returns:

Number:

setBarLevel

(
  • level
  • greenToRed
  • barNumber
)

Sets the bar level

Parameters:

  • level Number

    Selected level for the bar (0 - 10). 0 is off

  • greenToRed Boolean

    true if you start the level on the first green LED, false otherwise

  • barNumber Number

    If you have multiple LED bars chained together, this argument selects a specific bar starting at 0. The default is 0.