Go Down

Topic: Amarino - Android meets Arduino (Read 9 times) previous topic - next topic

Perfo

Has anyone used this to provide a handsfree function? It would mean connecting a microphone and speaker to the Arduino.
Thanks in anticipation.

patxeco

#21
Jul 21, 2010, 04:29 pm Last Edit: Jul 21, 2010, 04:34 pm by patxeco Reason: 1
Hi,

I am using Amarino application in my Nexus One with Android 2.1 to connect to my Arduino Lilypad. I am using the TestEvent to check if it works, and in the Lilypad I have loaded this code:


#include <MeetAndroid.h>

MeetAndroid meetAndroid;
int onboardLed13 = 13;

void setup()  
{
 Serial.begin(57600);
 
 meetAndroid.registerFunction(testEvent, 'A');  

 pinMode(onboardLed13, OUTPUT);
 //digitalWrite(onboardLed, HIGH);
}

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


void testEvent(byte flag, byte numOfValues)
{

 int randomValue = meetAndroid.getInt();
 
 if (randomValue>=125){
   digitalWrite(onboardLed13, HIGH);
 }
 else { digitalWrite(onboardLed13, LOW);
         delay(100);
 }

In the Monitoring screen of the N1 I can see:
  AmarinoService: message to send: 167
  AmarinoService: send to Arduino: A167
  .... (all the time random values are sent from N1 to Arduino)

But the Lilypad seems not to receive this values (the MeetAndroid.receive function always returns true) and doesnt blink led13...

Is it possible that the N1 is not set to 57600baud? why is he sending A167 and a strange square character?


I also have tried to use the MeetAndroid.send("a") in the loop(), but nothing is received in the N1.

Can anyone help me? Thanks!

Bonifaz

I guess your Bluetooth module is not configured to 57600 baud.

calidude

Is there anyway to communicate over the softserial instead of hardware serial? I have an OLED that can only work using the tx/rx pins. I have my bluetooth connected to pins 2 and 3 and I am communicating using the NewSoftSerial library.  Now I'm trying to use my phone to communicate with the bluetooth but the MeetAndroid library is only working for the tx/rx pins.  

-Cali

Nikropht

Is there a way to interface with the bluetooth over SPI?
This may fix the serial port problem.

-Nik

Go Up