Caleb Legis
/
Torquelab
d
Revision 0:8bf40ecafae6, committed 2015-10-15
- Comitter:
- caleblegis
- Date:
- Thu Oct 15 04:46:03 2015 +0000
- Commit message:
- A
Changed in this revision
diff -r 000000000000 -r 8bf40ecafae6 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Oct 15 04:46:03 2015 +0000 @@ -0,0 +1,45 @@ +#include "mbed.h" +#include "mbedWSEsbc.h" + + +//Max Lee, Caleb Legis +//ES305 +//Temperature Sensor + + +float measurement; // intialize measurement +float Ttime; +float Ts; +float dt; // Initialize change in time +float Time; // initialize time +int repeat; // initialize repeat variable +float Pi=3.14159; + + + +int main() { + //Initializes Mbed to access functionality of encoder, A/D, driver, etc. chipsets +mbedWSEsbcInit(115200); +// + + // +printf("Press 1 to begin"); // + +pc.scanf("%d,%f,%f",&repeat,&Ttime,&Ts); + +while (repeat==1) { + Time=0.0; + //once user enters 1, enters the while loop + //reset time variable +t.reset(); //reset timer object +while(Time<=Ttime) { + + measurement=LS7366_read_counter(2); // + pc.printf("%f,%f\n",Time,measurement); // + + Time=Time+Ts; //update time + dt= Ts - t.read(); // + wait(dt); // + t.reset(); } +pc.scanf("%d,%f,%f",&repeat,&Ttime,&Ts); +}}
diff -r 000000000000 -r 8bf40ecafae6 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Oct 15 04:46:03 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/4f6c30876dfa \ No newline at end of file
diff -r 000000000000 -r 8bf40ecafae6 mbedWSEsbc.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbedWSEsbc.lib Thu Oct 15 04:46:03 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/jebradshaw/code/mbedWSEsbc/#9041603c430e