Hello @Ricky here. For the last few days I have been working on establishing Serial Communication between the Spark Core and Arduino. I have them connected and I have the code, no blown up boards yet! Just there is one small problem, I am receiving things from the Arduino that I didn’t send in the first place. For example I am sending x from the Arduino, but on the Spark Core serial monitor I am receiving 255! I did a bit of research and I thing that this is the Ascii Characters, something that I have come across in other projects that I have done. I am posting this to see if anyone has ever come across it and knows what to do. If you need it here is my code:
Arduino code:
#include <Wire.h> // include wire library
void setup()
{
Wire.begin();
Serial.begin (9600);
// join i2c bus (address optional for master)
}
byte x = 0;
void loop()
{
Wire.beginTransmission(4); // transmit to device #4 (Spark Core)
Serial.print ("Sending in 1 second");
Serial.println();
delay (1000);
Wire.write("x is ");
Wire.write(x);
Serial.print ("Sent"); // Serial monitoring to see where the program is at
Serial.println();
delay (3000);
Wire.endTransmission(); // stop transmitting
x++; // add to x
delay(1000);
}
Spark Core code:
void setup() {
Serial.begin (9600);
Serial1.begin (9600); // used for communication to other devices
}
void loop() {
if (Serial1.available ()) {
Serial.print (Serial1.read ());
}
}
I’d suggest plugging in the power, that might help Also, could you perhaps say which connections you’ve used, since it’s pretty hard to see in the picture?
You’re using the Wire.h library in the arduino - that’s for I2C devices - not serial. If you want to read via the TX/RX pin on the Core you’ll need to use Serial1 on the arduino to send the data, and change the A4 connection to the TX pin.