a
Dependencies: LCD_DISCO_F429ZI mbed BSP_DISCO_F429ZI
led.cpp@6:06ff453bb16e, 2020-05-22 (annotated)
- Committer:
- matis755
- Date:
- Fri May 22 07:30:59 2020 +0000
- Revision:
- 6:06ff453bb16e
- Parent:
- 4:e48aee3e8d09
Use standard C functions
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
matis755 | 4:e48aee3e8d09 | 1 | #include "led.h" |
matis755 | 4:e48aee3e8d09 | 2 | |
matis755 | 4:e48aee3e8d09 | 3 | Led::Led() : led0(PG_4), led1(PG_5), led2(PG_6), led3(PG_7) { |
matis755 | 4:e48aee3e8d09 | 4 | |
matis755 | 4:e48aee3e8d09 | 5 | } |
matis755 | 4:e48aee3e8d09 | 6 | |
matis755 | 4:e48aee3e8d09 | 7 | |
matis755 | 4:e48aee3e8d09 | 8 | void Led::On(unsigned char ucLedIndex) |
matis755 | 4:e48aee3e8d09 | 9 | { |
matis755 | 4:e48aee3e8d09 | 10 | led0 = 0; |
matis755 | 4:e48aee3e8d09 | 11 | led1 = 0; |
matis755 | 4:e48aee3e8d09 | 12 | led2 = 0; |
matis755 | 4:e48aee3e8d09 | 13 | led3 = 0; |
matis755 | 4:e48aee3e8d09 | 14 | |
matis755 | 4:e48aee3e8d09 | 15 | switch(ucLedIndex){ |
matis755 | 4:e48aee3e8d09 | 16 | case 0: |
matis755 | 4:e48aee3e8d09 | 17 | led0 = 1; |
matis755 | 4:e48aee3e8d09 | 18 | break; |
matis755 | 4:e48aee3e8d09 | 19 | case 1: |
matis755 | 4:e48aee3e8d09 | 20 | led1 = 1; |
matis755 | 4:e48aee3e8d09 | 21 | break; |
matis755 | 4:e48aee3e8d09 | 22 | case 2: |
matis755 | 4:e48aee3e8d09 | 23 | led2 = 1; |
matis755 | 4:e48aee3e8d09 | 24 | break; |
matis755 | 4:e48aee3e8d09 | 25 | case 3: |
matis755 | 4:e48aee3e8d09 | 26 | led3 = 1; |
matis755 | 4:e48aee3e8d09 | 27 | break; |
matis755 | 4:e48aee3e8d09 | 28 | default: |
matis755 | 4:e48aee3e8d09 | 29 | break; |
matis755 | 4:e48aee3e8d09 | 30 | } |
matis755 | 4:e48aee3e8d09 | 31 | } |