Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
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.
LED led; //naming the variable type and then the name of variable.
|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);
This function turns on all the LEDs of the Jewelbot.
LED led; led.turn_on_all(GREEN);
This function turns off a single LED of the Jewelbot.
LED led; led.turn_off_single(NE);
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);