Go Down

Topic: Build Ball Maze controlled via gingerbread phone (Read 2476 times) previous topic - next topic


Dec 13, 2012, 11:50 am Last Edit: Dec 14, 2012, 02:30 am by Coding Badly Reason: 1
Hi, all first of all i want to apologize if don't know much about arduino. just starting to learn and if my English might not better explain what i'm trying to say. i found this project here ( http://www.instructables.com/id/DIY-Android-Ball-Maze-An-Introduction-to-the-And/ ) and im planning to improve it by adding a 3 stage board connected in a stair case style, the highest board would be the easy stage next the medium then the hard board. Plus  a automatic ball picker  using a conveyor that would carry the ball back to the board. with timer that will server as a score for the user.
The project name is 3 stage ball maze controlled via gingerbread android phone, using arduino mega 2560


1. it got a 3 stage, easy, medium and hard levels

2. controlled by an android phone gingerbread 2.3.4 or 2.3.6 version

3. it got an conveyor that would carry the ball back to the same board it has fallen into. after 3 tries it will go back to the first board which is the easy board.

now i understand that the materials needed for the project would be the following.

amarino 2.0
Arduino Mega 2560
standard servo motors x 6pcs
Bluesmirf Mate Gold to connect it to the phone 3pcs. one each per board
a 4 pin or 2 pin unipolar or bipolar stepper motor for the ball picker.
and a IR sensor that will detect anything that passes through it that will serve as a switch if anything that passes have count to 3 then will reverse to counterclockwise.

i need help in its programming side, coz im just a beginner that want to build something cool. i understand that as a beginner this is way to much for me. but i really want this to be realize before Christmas. i have already build the case, but don't have the right program to go with it.

Good Sir im asking if anyone of you could help me.

Feel free to edit or change the code.

i have here the code for the single board.

Code: [Select]

#include <Servo.h>
#include <MeetAndroid.h>

float data[3] = {0};
int intdata[3] = {0};
int i = 1;
Servo myservo;
int pos = 0;

MeetAndroid meetAndroid(error);

void error(uint8_t flag, uint8_t values){
 Serial.print("ERROR: ");

 void setup() {
meetAndroid.registerFunction(floatValues, 'A');  

void loop()

void floatValues(byte flag, byte numOfValues)
 for (int i=0; i<3;i++)

 if (-10<=data[1]<=10)   {
    intdata[1] = int(data[1]);
    intdata[1] = intdata[1]+10;
    pos = intdata[1]*9;
    if (-10<=data[0]<=10)   {
    intdata[0] = int(data[0]);
    intdata[0] = intdata[0]+10;
    pos = intdata[0]*9;


Go Up