Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: PsiSwarm_V8_Blank_CPP Autonomia_RndmWlk
Fork of PsiSwarmV7_CPP by
Led Class Reference
Led class Functions to control the various LEDs on the robot. More...
#include <led.h>
Public Member Functions | |
| void | set_leds (char green, char red) |
| Set all 8 outer LEDs to the defined colour sequence. | |
| void | set_green_leds (char green) |
| Set the green component of all 8 outer LEDs to the defined colour sequence. | |
| void | set_red_leds (char red) |
| Set the red component of all 8 outer LEDs to the defined colour sequence. | |
| void | set_led (char led, char state) |
| Set the state of an invididual outer LED without affecting other LEDs. | |
| void | set_base_led (char state) |
| Set the state of the base LEDs [if fitted]. | |
| void | blink_leds (float timeout) |
| Turns on all outer LEDs for a period of time defined by timeout then restore their previous state. | |
| void | set_center_led (char state) |
| Set the state the center LED. | |
| void | set_center_led (char state, float brightness) |
| Set the state the center LED with brightness control. | |
| void | set_center_led_brightness (float brightness) |
| Set the brightness of center LED without changing state. | |
| unsigned short | get_led_states (void) |
| Returns the current state of the outer LEDs. | |
| void | save_led_states (void) |
| Store the current LED states for use with restore_led_states() | |
| void | restore_led_states (void) |
| Restore the LED states to those set usign store_led_states() | |
Detailed Description
Led class Functions to control the various LEDs on the robot.
Example:
#include "psiswarm.h" int main() { init(); led.set_led(0,1); //Set the outer LED number 0 (North) to red led.set_led(4,3); //Set the outer LED number 4 (South) to orange (red+green) }
Definition at line 42 of file led.h.
Member Function Documentation
| void blink_leds | ( | float | timeout ) |
| unsigned short get_led_states | ( | void | ) |
| void restore_led_states | ( | void | ) |
| void save_led_states | ( | void | ) |
Store the current LED states for use with restore_led_states()
| void set_base_led | ( | char | state ) |
| void set_center_led | ( | char | state ) |
| void set_center_led | ( | char | state, |
| float | brightness | ||
| ) |
| void set_center_led_brightness | ( | float | brightness ) |
| void set_green_leds | ( | char | green ) |
| void set_led | ( | char | led, |
| char | state | ||
| ) |
| void set_leds | ( | char | green, |
| char | red | ||
| ) |
Set all 8 outer LEDs to the defined colour sequence.
- Parameters:
-
green - An 8-bit description of the green leds eg(0b00000001) means that LED 7 green is on, rest are off red - An 8-bit description of the red leds eg(0b11111110) means that LED 7 red is off, rest are on
Generated on Tue Jul 12 2022 21:11:24 by
1.7.2
