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.
LED.cpp
00001 #include "LED.h" 00002 00003 #include "../System/Using.h" 00004 #include "mbed.h" 00005 #include <stdint.h> 00006 00007 namespace LED { 00008 DigitalOut boardLED[USE_LED_NUM] = { 00009 DigitalOut(LED_DEBUG0_PIN), 00010 DigitalOut(LED_DEBUG1_PIN), 00011 DigitalOut(LED_DEBUG2_PIN), 00012 DigitalOut(LED_MU_PIN), 00013 }; 00014 00015 DigitalOut tapeLED[USE_TAPELED_NUM] = { 00016 DigitalOut(LED_TAPE0_PIN), 00017 DigitalOut(LED_TAPE1_PIN), 00018 DigitalOut(LED_TAPE2_PIN), 00019 DigitalOut(LED_TAPE3_PIN), 00020 DigitalOut(LED_TAPE4_PIN), 00021 }; 00022 00023 void LED::Initialize() { 00024 for(uint8_t i = 0; i < USE_LED_NUM; i++) { 00025 boardLED[i] = LED_OFF; 00026 } 00027 for(uint8_t i = 0; i < USE_TAPELED_NUM; i++) { 00028 tapeLED[i] = LED_OFF; 00029 } 00030 } 00031 00032 void LED::TapeledMode(uint8_t index) { 00033 int selectnum[16][4]= { 00034 //1,2,4,8 00035 {0,0,0,0}, 00036 {1,0,0,0}, 00037 {0,1,0,0}, 00038 {1,1,0,0}, 00039 {0,0,1,0}, 00040 {1,0,1,0}, 00041 {0,1,1,0}, 00042 {1,1,1,0}, 00043 {0,0,0,1}, 00044 {1,0,0,1}, 00045 {0,1,0,1}, 00046 {1,1,0,1}, 00047 {0,0,1,1}, 00048 {1,0,1,1}, 00049 {0,1,1,1}, 00050 {1,1,1,1} 00051 }; 00052 00053 for(uint8_t i = 0; i < USE_TAPELED_NUM; i++) { 00054 tapeLED[i] = selectnum[index][i]; 00055 } 00056 } 00057 }
Generated on Sat Jul 30 2022 20:08:28 by
1.7.2