-
Notifications
You must be signed in to change notification settings - Fork 1
LEDs
The LED
class constructs objects that represent a single LED attached to the physical Jewelbot. There are 4 LEDs total that are connected to the Jewelbot.
See Also:
LED led;
//naming the variable type and then the name of variable.
Property | Type | Value/Description |
---|---|---|
LED_Pos | number | Digital Pin. The Number address of the pin the led is attached to. The number address is referred to by cardinal directions SE=3, SW=0, NW=1, NE=2 |
ColorLabel | char | Preset RGB values. RED, GREEN, BLUE, YELLOW, MAGENTA, CYAN, WHITE |
-
.turn_on_single(LED_Pos led, ColorLabel color)
This function turns on a single LED of the Jewelbot.
LED led; led.turn_on_single(SW, GREEN);
-
.turn_on_all(ColorLabel color)
This function turns on all the LEDs of the Jewelbot.
LED led; led.turn_on_all(GREEN);
-
.turn_off_single(LED_Pos led)
This function turns off a single LED of the Jewelbot.
LED led; led.turn_off_single(NE);
-
.turn_off_all()
This function turns off all the LEDs of the Jewelbot.
LED led; led.turn_off_all();
-
.flash_single(LED_Pos led, ColorLabel color, uint8_t milliseconds)
This function turns on the LED for a set amount of time and then turns off.
LED led; led.flash_single(SE, BLUE, 1000);
-
.flash_all(ColorLabel color, uint8_t milliseconds)
This function turns all the LEDs for a set amount of time and then turns them off.
LED led; led.flash_all(BLUE, 1000);