Hello, I am trying to get an Arduino Uno and a Melexis Development Board (specifically the MLX90130) to talk to each. I have them hooked up together, but am not able to get them to speak to each other yet.
The code I have for the Arduino is:
#include <SoftwareSerial.h>
SoftwareSerial mySerial = SoftwareSerial(10,11);
void setup() {
Serial.begin(2400);
mySerial.begin(2400);
}
void loop() {
if (mySerial.isListening())
Serial.println("Melexis is listening!");
delay(1500);
if (mySerial.available())
Serial.write("Melexis is available!");
Serial.print('\n');
mySerial.listen();
mySerial.write(0100);
Serial.write(mySerial.read());
delay(1000);
}
The mySerial.write(0100); is a command sent to the Melexis; the 0100 is requesting basic information from the MLX90130, but I am not getting anything back. All that comes out in the Serial Moniter is "Melexis is listening!" repeatedly, and also a "ÿ" symbol. Could someone shed some light as to why they aren't speaking?
If mySerial.read is always returning -1, then that may be the case, but it will be difficult to see with all those ÿ scrolling past.
Why don't you check to see if there is something to read before reading it?
I doubt that the y like character IS the response. It is more likely that the y like character is result of reading something that isn't there. Post your new code, and a link to the device you are talking to.