David's dead reckoning code for the LVBots competition on March 6th. Uses the mbed LPC1768, DRV8835, QTR-3RC, and two DC motors with encoders.

Dependencies:   PololuEncoder Pacer mbed GeneralDebouncer

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);
    }
}