sample code for workshop

Dependencies:   mbed

Committer:
okano
Date:
Mon Apr 13 01:53:40 2015 +0000
Revision:
0:9300e8ff8060
initial version

Who changed what in which revision?

UserRevisionLine numberNew contents of line
okano 0:9300e8ff8060 1 #include "mbed.h"
okano 0:9300e8ff8060 2
okano 0:9300e8ff8060 3 BusOut leds( LED4, LED3, LED2, LED1 );
okano 0:9300e8ff8060 4 AnalogIn ai( p20 );
okano 0:9300e8ff8060 5 Serial ser( USBTX, USBRX );
okano 0:9300e8ff8060 6
okano 0:9300e8ff8060 7 int main() {
okano 0:9300e8ff8060 8 while(1) {
okano 0:9300e8ff8060 9 leds = (int)(ai * 15.0);
okano 0:9300e8ff8060 10 ser.printf( "voltage = %.2f\r\n", ai * 3.3 );
okano 0:9300e8ff8060 11 wait( 0.5 );
okano 0:9300e8ff8060 12 }
okano 0:9300e8ff8060 13 }