Test code for motors, sensors and leds

Dependencies:   PRRobot mbed

main.cpp

Committer:
jah128
Date:
2016-11-26
Revision:
1:17d31177e3c0
Parent:
0:e0510fa64cef
Child:
2:dfd136e31aaf

File content as of revision 1:17d31177e3c0:

#include "mbed.h"
#include "robot.h"

DigitalOut myled(LED1);
Robot robot;


int main() {
    robot.init();
    motors.init();
    led.start_test();
   
    while(1) {
        myled = 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);
        myled = 0;
        wait(0.1);
       // pc.printf("V: %3.3f\n",robot.get_battery_voltage());
    }
}