Stephen Davis
/
Template
commit for cli test
main.cpp@0:14b6781d6f40, 2017-02-25 (annotated)
- Committer:
- Stephen_NewVistas
- Date:
- Sat Feb 25 19:39:10 2017 +0000
- Revision:
- 0:14b6781d6f40
- Child:
- 1:6c3527fb3bc1
Initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Stephen_NewVistas | 0:14b6781d6f40 | 1 | #include "mbed.h" |
Stephen_NewVistas | 0:14b6781d6f40 | 2 | #include "rtos.h" |
Stephen_NewVistas | 0:14b6781d6f40 | 3 | |
Stephen_NewVistas | 0:14b6781d6f40 | 4 | DigitalOut led( LED2 ); |
Stephen_NewVistas | 0:14b6781d6f40 | 5 | Serial pc( USBTX , USBRX ); |
Stephen_NewVistas | 0:14b6781d6f40 | 6 | |
Stephen_NewVistas | 0:14b6781d6f40 | 7 | int main( void ){ |
Stephen_NewVistas | 0:14b6781d6f40 | 8 | |
Stephen_NewVistas | 0:14b6781d6f40 | 9 | led = 1; |
Stephen_NewVistas | 0:14b6781d6f40 | 10 | pc.baud( 115200 ); |
Stephen_NewVistas | 0:14b6781d6f40 | 11 | |
Stephen_NewVistas | 0:14b6781d6f40 | 12 | while( true ){ |
Stephen_NewVistas | 0:14b6781d6f40 | 13 | wait( 0.5 ); |
Stephen_NewVistas | 0:14b6781d6f40 | 14 | led = 0; |
Stephen_NewVistas | 0:14b6781d6f40 | 15 | pc.printf("LED = %d \n\r",led.read()); |
Stephen_NewVistas | 0:14b6781d6f40 | 16 | wait( 0.5 ); |
Stephen_NewVistas | 0:14b6781d6f40 | 17 | led = 1; |
Stephen_NewVistas | 0:14b6781d6f40 | 18 | pc.printf("LED = %d \n\r",led.read()); |
Stephen_NewVistas | 0:14b6781d6f40 | 19 | } |
Stephen_NewVistas | 0:14b6781d6f40 | 20 | |
Stephen_NewVistas | 0:14b6781d6f40 | 21 | } |