![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Programme de test du jeu du Fil
Dependencies: mbed Grove_LCD_RGB_Backlight
main.cpp@0:711fc0d9090e, 2022-05-12 (annotated)
- Committer:
- vermaelen
- Date:
- Thu May 12 15:06:24 2022 +0000
- Revision:
- 0:711fc0d9090e
V1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
vermaelen | 0:711fc0d9090e | 1 | #include "mbed.h" |
vermaelen | 0:711fc0d9090e | 2 | |
vermaelen | 0:711fc0d9090e | 3 | #include "Grove_LCD_RGB_Backlight.h" |
vermaelen | 0:711fc0d9090e | 4 | DigitalIn E1(D2); |
vermaelen | 0:711fc0d9090e | 5 | DigitalIn E2(D3); |
vermaelen | 0:711fc0d9090e | 6 | DigitalIn E3(D4); |
vermaelen | 0:711fc0d9090e | 7 | |
vermaelen | 0:711fc0d9090e | 8 | DigitalOut Buzzer(D9); |
vermaelen | 0:711fc0d9090e | 9 | DigitalOut Rouge(D14); |
vermaelen | 0:711fc0d9090e | 10 | DigitalOut Verte(D15); |
vermaelen | 0:711fc0d9090e | 11 | Grove_LCD_RGB_Backlight LCD(A4,A5); |
vermaelen | 0:711fc0d9090e | 12 | int main() |
vermaelen | 0:711fc0d9090e | 13 | { |
vermaelen | 0:711fc0d9090e | 14 | char tab[17]="LCD fonctionne"; |
vermaelen | 0:711fc0d9090e | 15 | char tab2[17]; |
vermaelen | 0:711fc0d9090e | 16 | LCD.setRGB(255,128,0); |
vermaelen | 0:711fc0d9090e | 17 | Rouge.write(1); |
vermaelen | 0:711fc0d9090e | 18 | Buzzer.write(1); |
vermaelen | 0:711fc0d9090e | 19 | wait(1); |
vermaelen | 0:711fc0d9090e | 20 | Buzzer.write(0); |
vermaelen | 0:711fc0d9090e | 21 | Verte.write(1); |
vermaelen | 0:711fc0d9090e | 22 | while(1) { |
vermaelen | 0:711fc0d9090e | 23 | sprintf(tab2,"E1=%d/ E2=%d/ E3=%d",E1.read(),E2.read(),E3.read()); |
vermaelen | 0:711fc0d9090e | 24 | |
vermaelen | 0:711fc0d9090e | 25 | LCD.locate(0,0); |
vermaelen | 0:711fc0d9090e | 26 | LCD.print(tab); |
vermaelen | 0:711fc0d9090e | 27 | LCD.locate(0,1); |
vermaelen | 0:711fc0d9090e | 28 | LCD.print(tab2); |
vermaelen | 0:711fc0d9090e | 29 | wait(0.2); |
vermaelen | 0:711fc0d9090e | 30 | } |
vermaelen | 0:711fc0d9090e | 31 | } |