![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Test code for motors, sensors and leds
main.cpp
- Committer:
- jah128
- Date:
- 2016-11-28
- Revision:
- 3:d42f51bcf883
- Parent:
- 2:dfd136e31aaf
- Child:
- 4:31e5dfbe68e8
File content as of revision 3:d42f51bcf883:
#include "mbed.h" #include "robot.h" Robot robot; int main() { robot.init(); while(1) { mbed_led1 = 1; /* for(int i=0;i<8;i++){ pc.printf("Sensor %d: %d\n",i,sensors.read_adc_value(i)); wait(0.05); } */ //robot.debug("Sensor 2: %d\n",sensors.get_adc_value(2)); wait(0.1); mbed_led1 = 0; wait(0.1); motors.set_left_motor_speed(0.25); robot.update_status_message(); robot.debug("Status message:["); for(int i=0;i<16;i++){ robot.debug("%2X ",status_message[i]); } robot.debug("]\n"); // pc.printf("V: %3.3f\n",robot.get_battery_voltage()); } }