benoit poulain
/
Exemple_Blinky
cours 1
main.cpp
- Committer:
- kanope_benny
- Date:
- 2020-10-01
- Revision:
- 9:41207561508d
- Parent:
- 8:c6ec6b9f6a55
File content as of revision 9:41207561508d:
#define TEST_BLINKY 0 #define TEST_USB_SERIAL 0 #define TEST_USB_SERIAL_BUT 1 #if TEST_USB_SERIAL_BUT #include "main.h" #include "USBSerial.h" DigitalIn but( PB_9 ); int but_input = 0 ; int main(){ setup(); USBSerial usb_pc; while( 1 ){ but_input = but ; usb_pc.printf(" but_input = %d \n", but_input); wait_ms( 200 ); } } #endif #if TEST_USB_SERIAL #include "main.h" #include "USBSerial.h" int main(){ setup(); USBSerial usb_pc; while( 1 ){ usb_pc.printf(" USB serial test \n"); wait_ms( 200 ); } } #endif #if TEST_BLINKY #include "main.h" DigitalOut myled( PC_13 ); int main(){ setup(); while( 1 ){ myled = 1 ; wait_ms( 200 ) ; myled = 0 ; wait_us( 200000 ) ; } } #endif