David's line following code from the LVBots competition, 2015.

Dependencies:   GeneralDebouncer Pacer PololuEncoder mbed

Fork of DeadReckoning by David Grayson

test.cpp

Committer:
DavidEGrayson
Date:
2014-02-22
Revision:
8:78b1ff957cba
Child:
9:9734347b5756

File content as of revision 8:78b1ff957cba:

// A file for testing routines that will not be used in the final firmware.

#include <mbed.h>
#include "motors.h"
#include "leds.h"
#include "pc_serial.h"

void testMotors()
{
    led1 = 1;
    led2 = 0;
    led3 = 0;
    while(1)
    {
        motors_speed_set(0, 0);
        led2 = 0;
        led3 = 0;
        wait(2);
        
        motors_speed_set(300, 300);
        wait(2);
        
        motors_speed_set(-300, 300);
        wait(2);
        
        motors_speed_set(0, 0);
        led2 = 1;
        wait(2);
        
        motors_speed_set(600, 600);
        wait(2);
        
        motors_speed_set(0, 0);
        led3 = 1;
        wait(2);
        
        motors_speed_set(1200, 1200);
        wait(2);
    }
}