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.
Diff: LED/LED.cpp
- Revision:
- 30:8f092276b2ba
- Parent:
- 29:44d5454ce8fa
- Child:
- 35:33c6cdba5630
--- a/LED/LED.cpp Fri Oct 18 22:33:25 2019 +0000
+++ b/LED/LED.cpp Tue Oct 22 02:03:26 2019 +0000
@@ -13,19 +13,25 @@
};
DigitalOut tapeLED[] = {
- DigitalOut(LED_tape0_PIN),
- DigitalOut(LED_tape1_PIN),
- DigitalOut(LED_tape2_PIN),
- DigitalOut(LED_tape3_PIN),
- DigitalOut(LED_tape3_PIN),
+ DigitalOut(LED_TAPE0_PIN),
+ DigitalOut(LED_TAPE1_PIN),
+ DigitalOut(LED_TAPE2_PIN),
+ DigitalOut(LED_TAPE3_PIN),
+ DigitalOut(LED_TAPE4_PIN),
};
void LED::Initialize() {
- for(uint8_t i=0; i < USE_LED_NUM; i++) {
+ for(uint8_t i = 0; i < USE_LED_NUM; i++) {
boardLED[i] = LED_OFF;
}
- for(uint8_t i=0; i < 5; i++) {
+ for(uint8_t i = 0; i < USE_TAPELED_NUM; i++) {
tapeLED[i] = LED_OFF;
}
}
+
+ void LED::TapeledMode(uint8_t index) {
+ for(uint8_t i = 0; i < USE_TAPELED_NUM; i++) {
+ tapeLED[i] = (index >> i) & 0x01;
+ }
+ }
}