Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: LineSensors mbed
DriveController.h
- Committer:
 - Hypna
 - Date:
 - 2014-10-16
 - Revision:
 - 5:f53f06a866e9
 - Parent:
 - 4:ac6b2e5b240b
 - Child:
 - 9:01c17b286a99
 
File content as of revision 5:f53f06a866e9:
#ifndef DRIVECONTROLLER_H
#define DRIVECONTROLLER_H
#include "mbed.h"
#include "LineSensors.h"
class DriveController
{
private:
    PwmOut wheelSpeed1;
    PwmOut wheelSpeed2;
    PwmOut wheelSpeed3;
    PwmOut wheelSpeed4;
    
    DigitalOut wheelDirection1;
    DigitalOut wheelDirection2;
    DigitalOut wheelDirection3;
    DigitalOut wheelDirection4;
    
    I2CSlave i2c;
    
    LineSensors sensors;
    bool sensorStates[8][3];
    
    int command;
    int edge;
    
    void move(char direction = 'F');
    void getCommand();
    void rotate(char direction);
    void sendComplete();
    int calculateError();
    bool intersection();
    
public:
    DriveController();
    void go();
};
#endif