i have a question regarding the unwanted/garbage data that shown in the serial monitor while running the Serialevent example. .
Well, my project is about sending the soil temperature sensor to other Arduino UNO by using an Arduino UNO in the sender side with XBee(type ZigBee Series 2) connected using Arduino wireless SD Shield which has a place for the XBee & for the SD Card, the receiver side will have the same components Arduino UNO, XBee ,Arduino wireless SD Shield & SD Card. .
i want to transmit the data of the sensor to the receiver and saving them in the SD Card, but the Problem is when i receive the data , i receive them with extra Unwanted data in the beginning of each line of the results , as seen in the picture in the Attachment !
I think the problem is with the code of the Serialevent .
Have you first tried using a wired connection between the two arduinos for trouble shooting? As others have said, if you really want anybody to look at your code, you need to post sending and receiving using the code box </>.
These are the two code for the sender side & the Receiver side . . i think the problem is with the receiver, but if you can't find the problem see the sender code.
It makes NO sense to do software serial on the hardware serial pins. If you are going to sacrifice the hardware serial pins, use an instance of HardwareSerial (Serial).
Serial.begin(9600);
You can NOT do hardware serial AND software serial on the same set of pins.
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
Do you HAVE a Leonardo?
char Receive = Serial.read();
Before Serial.begin()? That was useless.
I'm going to assume that the receiver is a flawed as the sender.
i tried the 2nd example, but it just print the first letter of the sting, i do not know why, so i changed to the previous code .
PaulS :
these lines i added them previously to try something else, so i just kept them here since they have No effect on the results if i removed them as i noticed . . so , when i remove them, the result still the same
Know i tried to remove some of the Garbage like the symbol ( ~ ) by just doing this step :
Since, i noticed that it removes whateve in first place of the Serial.readBytesUntil( , , ).
And it really removes the (~) sign & left with only one symbol of Garbage