![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Compass Working
Diff: main.cpp
- Revision:
- 2:ef6778c2438e
- Parent:
- 1:ef74b3428716
- Child:
- 4:92024cb66c9c
diff -r ef74b3428716 -r ef6778c2438e main.cpp --- a/main.cpp Wed Jan 13 22:31:54 2016 +0000 +++ b/main.cpp Thu Jan 14 02:04:19 2016 +0000 @@ -1,18 +1,27 @@ #include "Compass.h" #include "Temperature.h" #include "mbed.h" +#include "Tap.h" Serial pc(USBTX,USBRX); double direction; float temp2; -char tap; +float tap; int main() { while(1){ - direction = Compass(); + direction = Compass(); temp2 = Temperature(); tap = Tap(); - pc.printf("%1.2f degrees\t %1.2f temperature %1.2f tap \n\r" , direction, temp2,tap); + if(tap ==1) + { + pc.printf( "%1.2f = Temperature \n\r" , temp2); + } + if(tap==2) + { + pc.printf( "%1.2f = Direction \n\r" , direction); + } + pc.printf( "%1.2f = Taps \n\r" , tap); } }