Pages: [1]   Go Down
Author Topic: Build Ball Maze controlled via gingerbread phone  (Read 800 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Features:

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:

#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: ");
  Serial.print(flag);
}

  void setup() {
  Serial.begin(115200);
 meetAndroid.registerFunction(floatValues, 'A');  
  myservo.attach(9);
}

void loop()
{
  meetAndroid.receive();}

void floatValues(byte flag, byte numOfValues)
{
  meetAndroid.getFloatValues(data);
  for (int i=0; i<3;i++)
  {
    meetAndroid.send(data[i]);
  }

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

}


 
« Last Edit: December 13, 2012, 08:30:03 pm by Coding Badly » Logged

Pages: [1]   Go Up
Jump to: