Hi again with out looking a fool I spent a few nights now looking at my very basic code to find what is wrong.
In my last post I was having to Arduino chat to each other via Serial. Sorted that one thanks to the pointers in the correct direction. But
My mega to Mega Serial connection suffers from a lot of interference and it just print L and K or ÿ so I have had to connect them over the SDA and SDL which works find the trouble is making that a usable data for a If statement.
// function that executes whenever data is received from master
// this function is registered as an event, see setup()
void receiveEvent(int howMany)
{
while(1 < Wire.available()) // loop through all but the last
{
char c = Wire.read(); // receive byte as a character
c = Serial.print(c);}
}
int x = Wire.read(); // receive byte as an integer
Serial.println(x); // print the integervoid loop()
{}
I know there is nothing in the Void Loop part because I have deleted everything I have tried so a little pointer would be a great help I have looked all over the internet using Google and cant seem to find what I am looking for. Once this is done I can stop posting as my project will be so close to finished