Hi every one, I write here because i'm working on a porject where my idea is to connect an android mobile (LG.GT540) to an Arduino (Duemilanove), Here I write down the blog where the project is described and where you can comment what ever you want.
I Would like to know what do you think I should start working.
In order to work with the audio port from an Arduino device, i would like to know which are the libraries I should use.
How should I use the data?? I would like also to know about the schematic that I should build with the Arduino tablet.
Thank you very much, I hope to read all your suggestions.
after looking for more information, I found this web: http://bit.ly/pJFurJ where they connect an arduino with an smartphone using the audio port, and a little bit further down they make the same experiment that i'm trying, they mesure the temperature and they show it in a smartphone.
I would like to know what is what they are really reading and writting, from the thermistor we get a constant value, that is needed to be converted into a digital signal, that is what arduino is used for, and then converted into an analog signal with its fundamental frequency iqual to the value of the temperature, isn't it?? How can i do that??
I would like to know what is what they are really reading and writting, from the thermistor we get a constant value, that is needed to be converted into a digital signal, that is what arduino is used for, and then converted into an analog signal with its fundamental frequency iqual to the value of the temperature, isn't it?? How can i do that??
Answer to your question in the SoftModem-004.zip file, you can download from the link.
Ok, More or less I understand the code, now the issue is to mix the codes about reading the temperature form the thermistor and the soft modem, does it have to be everything in the same code?? or one for reading the thermistor and another for sending data to the samrtphone??
Please, use # symbol on button bar (above smiles) whenever you post a code.
If you look into : void SoftModem::write(uint8_t data), prototype function has a deal with uint8_t, that is unsigned byte or just char. So if you need to send a temperature, there are two option:
send data, taken from ADC, as two (HIGH LOW) bytes to android, combine them back and do all mathematic formula calculation int-->float on android;
calculate on arduino, then split float T (32 - bits) in four bytes, send them individually to android and assembly float T back on android.
Search on the forum, there are millions thread how to do splitting/combining using atoi/atol/atof/strtol etc functions.
edited:
Just come across:
#include
#include
SoftModem modem;
int temperaturePin = 0;
void setup ()
{
Serial . begin (9600);
modem. begin ();
Serial . println ("Start");
}
void loop ()
{
float degree;
float fahren;
float temperature = getVoltage(temperaturePin);
temperature = temperature * 100;
degree=temperature-273;
Serial.print(fahren);
Serial.println(" F");
Serial.println(degree);
Serial.println(temperature);
sending(degree);
delay(2000);
}
float getVoltage(int pin)
{
return (analogRead(pin)* .004882814);
}
void sending(float temp)
{
int b10;
int m1;
int b1;
int m01;
int b01;
int m001;
int b001;
int u;
u=temp*100;
b10=u/1000;
m1=u%1000;
b1=m1/100;
m01=m1%100;
b01=m01/10;
m001=m01%10;
b001=m001;
modem.write(b10+48);
modem.write(b1+48);
modem.write(46);
modem.write(b01+48);
modem.write(b001+48);
modem.write(67);
modem.write(32);
modem.write(32);
delay(200);
}
use his android code and arduino code,hardware is NexusOne , and use The cable with which gilding specification was shielded (???????????????????????????)
the ????Android->Arduino?is succeed,
but ?Arduino ->Android?alway Failure ----cellphone is nothing happen
who can tell me what error?
i see the website say:
????Arduino->Android?????????????????????????????????????????
?????????????????????????????????????????????????????????????????????????????????????????