First release.
Dependencies: FXOS8700CQ SDFileSystem mbed
Final program
- Controling a robot by Bluetooth, it is capable of making 90° turns and move pre-defined distances.
Code by:
- Mayumi Hori
- Sarahí Morán
- Gerardo Carmona
Diff: my_libraries/ultrasonic.cpp
- Revision:
- 4:c60636c95b80
- Parent:
- 3:bd16e43ad7be
--- a/my_libraries/ultrasonic.cpp Fri Oct 17 06:21:52 2014 +0000 +++ b/my_libraries/ultrasonic.cpp Fri Oct 17 09:08:06 2014 +0000 @@ -17,12 +17,15 @@ // ----- Functions ------------------------------------------------------------------ float ultrasonicos(int sensor){ + double inch, volts; if (sensor == ULTRA_R) { read_sensor = ultra_rig; // read analog as a float }else if (sensor == ULTRA_L) { read_sensor = ultra_lef; // read analog as a float } // read_sensor * 3300mv / 6.4 mV/in * 2.54 in/cms - cm = read_sensor * 1309.6875; + volts = read_sensor * 3300; + inch = volts / 6.4; + cm = inch * 2.54; return cm; } \ No newline at end of file