Automata-Development edited this page Jul 16, 2017 · 14 revisions

Welcome to the Make-A-Pede Arduino Library wiki!

Getting Started

Download the repository as a .zip file. In the Arduino IDE, add the library (Sketch->Include Library->Add .ZIP library...). This will add the library to your "libraries" folder. To use the library in your sketch, include it by adding #include <MakeAPede.h> to the top of the file.

Open the remote control example program by clicking File->Examples->Make-A-Pede->RemoteControl. Upload the program to your robot.

If using the Arduino 101, the "Intel Curie Boards" package must be installed using the Boards Manager (Tools->Board->Boards Manager) and "Arduino/Genuino 101" must be selected in the Tools->Board menu.

To use the gyro on the Arduino 101 or to use the eye displays, #define USE_IMU and/or #define USE_DISPLAY must be uncommented at the top of MakeAPede.h.

Example Programs

RemoteControl

Simple remote program using smartphone Bluetooth control.

ObstacleAvoidAutonomous

Simple autonomous program that avoids obstacles using the antennae.

Functions

void setupMaP()

Configures Bluetooth and outputs for Make-A-Pede. Should be called in setup().

void bluetoothControl()

Receives and processes messages from connected Bluetooth device. Should be called in loop(). Calls userCode() repeatedly.

void userCode()

Function defined in user's sketch called in the loop inside bluetoothControl(). This must be defined inside the user's sketch.

void setLeftSpeed(int speed)

Set the speed of the left side of the drive in the range of 0-255.

void setRightSpeed(int speed)

Set the speed of the right side of the drive in the range of 0-255.

void setLeftDirection(int dir)

Set the direction of the left side of the drive (LOW (forwards) or HIGH (backwards)).

void setRightDirection(int dir)

Set the direction of the right side of the drive (LOW (forwards) or HIGH (backwards)).

int getLeftAntennae()

Get the current value of the left antennae sensor (LOW (not pressed) or HIGH (pressed)).

int getRightAntennae()

Get the current value of the right antennae sensor (LOW (not pressed) or HIGH (pressed)).

void enableObstacleAvoid(bool enable)

Enable/disable obstacle avoidance using the antennae sensors.

void getHeading()

Read the value of Arduino 101's integrated gyroscope into the "heading" variable. Only available on the 101 and if USE_IMU is defined in MakeAPede.h.

void setupDisplay()

Configure eye displays. Only available if USE_DISPLAYS is defined in MakeAPede.h.

void showEyes()

Display eyes on the displays. Only available if USE_DISPLAYS is defined in MakeAPede.h.

Variables

int leftSpeed

The speed of the left motors in the range 0-255. This can read/modified inside userCode.

int rightSpeed

The speed of the right motors in the range 0-255. This can read/modified inside userCode.

int leftDir

The direction of the left motors (LOW is forward and HIGH is backward). This can read/modified inside userCode.

int rightDir

The direction of the right motors (LOW is forward and HIGH is backward). This can read/modified inside userCode.

float heading

The heading of robot as read from the Arduino 101's integrated gyroscope. Updated when getHeading is called. Only available on the 101 and if USE_IMU is defined in MakeAPede.h.

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.