Stephen Davis
/
Template
commit for cli test
main.cpp@2:189a262001bb, 2017-03-10 (annotated)
- Committer:
- Stephen_NewVistas
- Date:
- Fri Mar 10 20:54:39 2017 +0000
- Revision:
- 2:189a262001bb
- Parent:
- 1:6c3527fb3bc1
deleted rtos.lib
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 | |
Stephen_NewVistas | 0:14b6781d6f40 | 3 | DigitalOut led( LED2 ); |
Stephen_NewVistas | 0:14b6781d6f40 | 4 | Serial pc( USBTX , USBRX ); |
Stephen_NewVistas | 1:6c3527fb3bc1 | 5 | AnalogOut out( A4 ); |
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 | 1:6c3527fb3bc1 | 14 | led = 0; |
Stephen_NewVistas | 1:6c3527fb3bc1 | 15 | out.write( 3.0 ); |
Stephen_NewVistas | 0:14b6781d6f40 | 16 | pc.printf("LED = %d \n\r",led.read()); |
Stephen_NewVistas | 0:14b6781d6f40 | 17 | wait( 0.5 ); |
Stephen_NewVistas | 1:6c3527fb3bc1 | 18 | led = 1; |
Stephen_NewVistas | 1:6c3527fb3bc1 | 19 | out.write( 0.0 ); |
Stephen_NewVistas | 0:14b6781d6f40 | 20 | pc.printf("LED = %d \n\r",led.read()); |
Stephen_NewVistas | 0:14b6781d6f40 | 21 | } |
Stephen_NewVistas | 0:14b6781d6f40 | 22 | |
Stephen_NewVistas | 0:14b6781d6f40 | 23 | } |