Version final modification amplitude et période d'un sinus
Dependencies: mbed ihm_L476_full
main.cpp@0:b30577700066, 2020-05-06 (annotated)
- Committer:
- grimwald
- Date:
- Wed May 06 16:12:07 2020 +0000
- Revision:
- 0:b30577700066
- Child:
- 1:4fb9517beb4d
Code terminal
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
grimwald | 0:b30577700066 | 1 | #include "mbed.h" |
grimwald | 0:b30577700066 | 2 | |
grimwald | 0:b30577700066 | 3 | Serial pc(SERIAL_TX, SERIAL_RX);//permet la communication avec le terminal en liason seri |
grimwald | 0:b30577700066 | 4 | DigitalOut led(LED1); |
grimwald | 0:b30577700066 | 5 | |
grimwald | 0:b30577700066 | 6 | int main() |
grimwald | 0:b30577700066 | 7 | { |
grimwald | 0:b30577700066 | 8 | pc.printf("Press '1' to turn LED1 ON, '0' to turn it OFF\n");// va print sur le terminal |
grimwald | 0:b30577700066 | 9 | while(1) { |
grimwald | 0:b30577700066 | 10 | char c; |
grimwald | 0:b30577700066 | 11 | pc.printf("Tapez 1 pour allumer 0 pour eteindre:"); |
grimwald | 0:b30577700066 | 12 | pc.scanf("%c",&c);// va nous permettre d'entrer l'état 1 ou 0 (on/off) depuis le terminal. |
grimwald | 0:b30577700066 | 13 | |
grimwald | 0:b30577700066 | 14 | if (c == '0') { |
grimwald | 0:b30577700066 | 15 | led = 0; // OFF |
grimwald | 0:b30577700066 | 16 | } |
grimwald | 0:b30577700066 | 17 | if (c == '1') { |
grimwald | 0:b30577700066 | 18 | led = 1; // ON |
grimwald | 0:b30577700066 | 19 | } |
grimwald | 0:b30577700066 | 20 | } |
grimwald | 0:b30577700066 | 21 | } |