大季 矢花
/
MB2019_main_alltimes_1123
aa
Diff: LED/LED.cpp
- Revision:
- 35:33c6cdba5630
- Parent:
- 30:8f092276b2ba
--- a/LED/LED.cpp Tue Oct 29 08:35:05 2019 +0000 +++ b/LED/LED.cpp Tue Oct 29 14:54:17 2019 +0000 @@ -12,7 +12,7 @@ DigitalOut(LED_MU_PIN), }; - DigitalOut tapeLED[] = { + DigitalOut tapeLED[USE_TAPELED_NUM] = { DigitalOut(LED_TAPE0_PIN), DigitalOut(LED_TAPE1_PIN), DigitalOut(LED_TAPE2_PIN), @@ -30,8 +30,28 @@ } void LED::TapeledMode(uint8_t index) { + int selectnum[16][4]= { + //1,2,4,8 + {0,0,0,0}, + {1,0,0,0}, + {0,1,0,0}, + {1,1,0,0}, + {0,0,1,0}, + {1,0,1,0}, + {0,1,1,0}, + {1,1,1,0}, + {0,0,0,1}, + {1,0,0,1}, + {0,1,0,1}, + {1,1,0,1}, + {0,0,1,1}, + {1,0,1,1}, + {0,1,1,1}, + {1,1,1,1} + }; + for(uint8_t i = 0; i < USE_TAPELED_NUM; i++) { - tapeLED[i] = (index >> i) & 0x01; + tapeLED[i] = selectnum[index][i]; } } }