complete

Dependencies:   4DGL-uLCD-SE PinDetect mbed

Fork of my2036lab2robotLCD by jim hamblen

Robot.h

Committer:
jboettcher
Date:
2016-11-06
Revision:
1:5a1311f0ea06
Parent:
0:343fbeea672c

File content as of revision 1:5a1311f0ea06:

#include <iostream>
using namespace std;

class Robot
{
public:
    void draw() {
        uLCD.filled_circle(xPosition, yPosition, 2, BLUE);
        uLCD.filled_circle(xPosition - 8, yPosition - 8, 4, GREEN);    
        uLCD.filled_circle(xPosition + 8, yPosition - 8, 4, GREEN);    
        uLCD.filled_rectangle(xPosition - 5, yPosition + 10, xPosition + 5, yPosition + 5 , BLACK); 
        uLCD.circle(xPosition, yPosition, 18, BLACK);    }
    void erase() {
        uLCD.filled_rectangle(0, 126, 126, 26, RED);    }
    void moveForward(int distance) {
        yPosition++;    }
    void moveBackward(int distance) {
        yPosition--;    }
    void moveLeft(int distance) {
        xPosition--;    }
    void moveRight(int distance) {
        xPosition++;    }
    Robot() {
        xPosition = 63;
        yPosition = 63;
    }
private:
    int xPosition;
    int yPosition;
};