The first code

Dependencies:   mbed Motor

Committer:
170198
Date:
Thu Feb 05 15:15:47 2015 +0000
Revision:
2:559b5507c580
Parent:
1:a46a378d5561
Child:
3:7b0316e7cabc
Elevator;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
170198 0:2f38be5ec9dc 1 #include "mbed.h"
170198 1:a46a378d5561 2 #include "time.h"
170198 0:2f38be5ec9dc 3
170198 0:2f38be5ec9dc 4 AnalogIn ain(p17);
170198 1:a46a378d5561 5 Serial pc(USBTX, USBRX);
170198 1:a46a378d5561 6 Timer t;
170198 2:559b5507c580 7
170198 1:a46a378d5561 8 int main(void)
170198 1:a46a378d5561 9 {
170198 1:a46a378d5561 10 t.reset(); //reset timer to zero
170198 1:a46a378d5561 11 t.start(); //start timer data timestamp
170198 1:a46a378d5561 12 while(1)
170198 1:a46a378d5561 13 {
170198 1:a46a378d5561 14 pc.baud(9600);
170198 1:a46a378d5561 15 pc.format(7,SerialBase::None,1);
170198 1:a46a378d5561 16 pc.printf("%f",ain.read()); //this prints the voltage
170198 1:a46a378d5561 17 pc.printf("%f,",t.read());
170198 1:a46a378d5561 18 pc.printf("\n");
170198 1:a46a378d5561 19 }
170198 0:2f38be5ec9dc 20 }