![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Test program - based on blink program from MBED
main.cpp@0:10cc86071dd4, 2021-12-05 (annotated)
- Committer:
- villemejane
- Date:
- Sun Dec 05 13:08:56 2021 +0000
- Revision:
- 0:10cc86071dd4
Test program - based on blink program from MBED
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
villemejane | 0:10cc86071dd4 | 1 | /* |
villemejane | 0:10cc86071dd4 | 2 | * Programme de test |
villemejane | 0:10cc86071dd4 | 3 | * Auteur : J. VILLEMEJANE / Dec 2021 / IOGS |
villemejane | 0:10cc86071dd4 | 4 | * From : MBED Example / Blinky LED |
villemejane | 0:10cc86071dd4 | 5 | */ |
villemejane | 0:10cc86071dd4 | 6 | |
villemejane | 0:10cc86071dd4 | 7 | /* Déclaration des ressources externes */ |
villemejane | 0:10cc86071dd4 | 8 | #include "mbed.h" |
villemejane | 0:10cc86071dd4 | 9 | |
villemejane | 0:10cc86071dd4 | 10 | /* Déclaration des variables globales */ |
villemejane | 0:10cc86071dd4 | 11 | |
villemejane | 0:10cc86071dd4 | 12 | /* Déclaration des entrées/sorties */ |
villemejane | 0:10cc86071dd4 | 13 | DigitalOut myled(LED1); |
villemejane | 0:10cc86071dd4 | 14 | |
villemejane | 0:10cc86071dd4 | 15 | /* Fonction principale */ |
villemejane | 0:10cc86071dd4 | 16 | int main(){ |
villemejane | 0:10cc86071dd4 | 17 | /* Zone d'initialisation */ |
villemejane | 0:10cc86071dd4 | 18 | |
villemejane | 0:10cc86071dd4 | 19 | /* Boucle infinie */ |
villemejane | 0:10cc86071dd4 | 20 | while(1){ |
villemejane | 0:10cc86071dd4 | 21 | myled = 1; // LED is ON |
villemejane | 0:10cc86071dd4 | 22 | wait_us(200000); // 200 ms |
villemejane | 0:10cc86071dd4 | 23 | myled = 0; // LED is OFF |
villemejane | 0:10cc86071dd4 | 24 | wait_us(1000000); // 1 s |
villemejane | 0:10cc86071dd4 | 25 | } |
villemejane | 0:10cc86071dd4 | 26 | } |