Hello to whoever finds this helpful. This is also my first instructable!
A little bit of my background: I'm a bored teenaged kid that spends way too much time on Facebook and watched way too much James Bond as a kid. Right now i'm listening to a song called Stolen Dog by Burial, it's pretty sick. ANYWAYS, I'm not in college and I don't have a professional degree in anything. I've been taking C++ classes at a community college/teaching myself C for AVR and have found Arduino to be super easy and super fun and super powerful. The bottom line: If I can do this, anybody can.
I didn't document my project as well as I should have.
But what I did was modify a RC james bond aston martin car to be controlled by my Android phone. -I was going for a james bond kind of deal.
I've seen a lot of development between Android and embedded systems lately, which is really cool, cause it's really cool stuff.
The important part of this instructable is to find the best platform
by platform I mean android app, do I want to use amarino, which can only send sensor-accelerometer data, or do I want to create my own android app that incorporates buttons and accelerometer data?
But, creating your own app is pretty hard if you don't know a thing about java or android.
But, using amarino limits you to only using accelerometer data, which is cool, but for me got lame pretty fast.
Wait, the multicolor lamp uses sliders, I bet somebody could use buttons. I just don't know how to do it, so I might as well use somebody else's work. : )
A while back I came across a GREAT GREAT FANTASTIC website: http://uzzors2k.4hv.org/index.php?page=blucar
Some of the stuff this guy did kind of blew my mind.
It was hard to understand his website because he compiled his avr microcontroller code with micro C, and for me, I was used to the avr gcc compiler. But I was also not as experienced with setting up a serial port with an attiny. Uzzors also created an Android app to control his attiny.
I really wanted to either modify his app or reverse engineer it for my own purposes because it incorporates both accelerometer functionality for steering his car and buttons to control the forward and reverse functions.
I wanted to use Uzzors app with Arduino, because its Arduino, super easy to use, super powerful at the same time.
======================================================================================
I originally wanted to use Uzzors App but I honestly couldn't understand it. I remember thinking, "Oh man, I'm in over my head man!". So I built my car which was all hardware, but I was using amarino to control all the functions. I'm sure you can find a lot about amarino, its pretty cool, but also pretty lame after a while, because you can't create buttons, you can only use sensors. But don't get me wrong, amarino is SICK when you start using it.
I'm just trying to shed some light that I thought was previously out of reach, and I think that Uzzors app seemed out of reach for folks like me!
So what am I saying? You can use Uzzors cool App with Arduino, and not only the Attiny. Check it out on the android app store, search Blucar and your set.
I know nothing about Java. Sucks.
This is all the hardware stuff:
Remove these ads by
Signing UpStep 1Amarino
I'm using a rooted HTC inspire.
go to http://www.amarino-toolkit.net/index.php/download.html for more info.
I was experimenting with the switch case to try and get faster response times. do what ever you want. there used to be an if statement there.
I actually modified somebody's code off the internet, so some things seem arbitrary. (I hope I didn't use that word wrong..)
Your going to have to download the Amarino library for the Arduino IDE off their website.
#include <MeetAndroid.h>
#include <Servo.h>
MeetAndroid meetAndroid;
Servo myservo; //controls the steering
Servo motor; //controls the for/rev motor
void setup()
{
Serial.begin(9600); //default baud rate for bt module
meetAndroid.registerFunction(phoneorient, 'A'); //use event A in amarino
myservo.attach(9); //servo
motor.attach(8); //forward/backwards motor
}
void loop()
{
meetAndroid.receive(); // you need to keep this in your loop() to receive events
}
void phoneorient(byte flag, byte numOfValues)
{
//Phone Orientation Controller
int values[]={0,0,0};
meetAndroid.getIntValues(values);
// You must hold phone in LANDSCAPE for following orientation.
double x=values[1]; //store x as a double (long decimal number)
int y=values[2];
int z=values[3];
x = (-x); //my steering was reversed, quick fix
if (x>2)
{
myservo.write(105 + (x-2)*2.5); //values determined by trial and error for my car
}
else if (x< -2)
{
myservo.write(105 + (x+2)*3.571); //unique for my car
}
else
{
myservo.write(105); //unique center steering position
}
/* if (y>=7)
{
//motor.write(180);
motor.write(90 + 25*(y-7));
} */
switch (y) //tried to use a switch statement so that the motor was faster, reverse is a little glitchy I recommend using the if statement //anyways. If you do use the if, change y to a float/double instead of int.
{
case 9:
motor.write(180);
break;
case 8:
motor.write(150);
break;
case 7:
motor.write(120);
break;
case 6:
case 5:
case 4:
case 3:
case 2:
case 1:
case 0:
motor.write(90);
break;
case -1:
case -2:
case -3:
case -4:
case -5:
case -6:
case -7:
case -8:
case -9:
motor.write(30);
break;
}
/*else if (y<1)
{
motor.write(90 - (y-1)*);
//motor.write(30);
}
else
{
motor.write(90);
}*/
}
| « Previous Step | Download PDFView All Steps | Next Step » |






































btw, can u list the components of yours and where to get them man? its confusing. where to buy the h bridge and 4 mhz crystal and everything
Please list ur components name and how to get them, man, u have made the code to be "newbie"-enabled but the components are still not newbie reachable.
I have installed the java prog version of android
can you guys tell me how to access the accelerometer in JAVA and bluetooth module to send data??
thanks a lot