Hello,
I work on a school projet in France, I have to send an information from a mobile phone with an application made with App inventor on my Arduino mega by a bluetooth grove module. I've try to do some test to learn how may work the bluetooth communication, I chose a tutorial on google but it don't work. Finally I found the probleme with on of my classmate, that's work on an Arduino uno (i've try and that's ok) but not on a Mega
I work with a Mega 2560, a "Grove - Mega Shield", a grove bluetooth V3.01 and a led. I just try to turn the led on from my phone
My programme is :
#include <SoftwareSerial.h>
SoftwareSerial HC06(0,1);
const char DOUT_LED = 2;
String messageRecu;
void setup() {
Serial.begin(9600);
HC06.begin(9600);
pinMode(DOUT_LED, OUTPUT);
digitalWrite(DOUT_LED, LOW);
}
void loop()
{
while(HC06.available()) //Tant que le bluetooth est connecté
{
delay(3);
Serial.println("ok");
char c = HC06.read();
//char c = Serial.read();
messageRecu += c;
}
if (messageRecu.length() >0)
{
Serial.println(messageRecu);
if (messageRecu == "1")
{digitalWrite(DOUT_LED, HIGH);delay(2000);}
if (messageRecu == "0")
{digitalWrite(DOUT_LED, LOW);delay(3000);}
messageRecu="";
}
}
The shield got foor UART ports
I put my Programm on App Inventor at The end.
A picture of the shiel :


