Test code for motors, sensors and leds

Dependencies:   PRRobot mbed

Committer:
jah128
Date:
Sat Nov 26 21:50:27 2016 +0000
Revision:
2:dfd136e31aaf
Parent:
1:17d31177e3c0
Child:
3:d42f51bcf883
Added extra leds

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jah128 0:e0510fa64cef 1 #include "mbed.h"
jah128 0:e0510fa64cef 2 #include "robot.h"
jah128 0:e0510fa64cef 3
jah128 0:e0510fa64cef 4 Robot robot;
jah128 0:e0510fa64cef 5
jah128 0:e0510fa64cef 6 int main() {
jah128 0:e0510fa64cef 7 robot.init();
jah128 0:e0510fa64cef 8 motors.init();
jah128 0:e0510fa64cef 9 led.start_test();
jah128 1:17d31177e3c0 10
jah128 0:e0510fa64cef 11 while(1) {
jah128 2:dfd136e31aaf 12 mbed_led1 = 1;
jah128 0:e0510fa64cef 13 /*
jah128 0:e0510fa64cef 14 for(int i=0;i<8;i++){
jah128 0:e0510fa64cef 15 pc.printf("Sensor %d: %d\n",i,sensors.read_adc_value(i));
jah128 0:e0510fa64cef 16 wait(0.05);
jah128 0:e0510fa64cef 17 }
jah128 0:e0510fa64cef 18 */
jah128 0:e0510fa64cef 19
jah128 1:17d31177e3c0 20 robot.debug("Sensor 2: %d\n",sensors.get_adc_value(2));
jah128 0:e0510fa64cef 21 wait(0.1);
jah128 2:dfd136e31aaf 22 mbed_led1 = 0;
jah128 0:e0510fa64cef 23 wait(0.1);
jah128 0:e0510fa64cef 24 // pc.printf("V: %3.3f\n",robot.get_battery_voltage());
jah128 0:e0510fa64cef 25 }
jah128 0:e0510fa64cef 26 }