I have an RFID reader: http://img.tradeindia.com/fp/1/641/264.jpg
Something like above along with ITEAD TFT shield & GSM Modem. The RFID reader has an RS-232 port as well as GND, TX and 5V pins. I am using an Arduino Mega 2560 board. I have connected the TX, GND of RFID reader to RX3 pin 15 / GND (pin) of Arduino. Note I am supplying 12 V to RFID via an adapter.
Note the ITEAD TFT shield consumes the TX0, RX0 pins—so I cannot make use of the RX0 and TX0 pins. Though I have not written the code for GSM modem.
Now while running the program below, I am getting junk output both in my TFT display as well as the serial monitor:
#define __AVR__
#include <UTFT.h>
// Declare which fonts we will be using
extern uint8_t SmallFont[];
extern uint8_t BigFont[];
extern uint8_t SevenSegNumFont[];
UTFT myGLCD(ITDB24,59,58,57,56);
String myString = "";
void setup() {
Serial3.begin(9600);
myGLCD.InitLCD();
myGLCD.clrScr();
}
void loop() {
myGLCD.setFont(BigFont);
if (Serial3.available()) {
int inByte = Serial3.read();
myString += String(inByte);
}
if(myString.length() == 10)
myGLCD.print(myString, CENTER, 0);
}
TFT Screen output:
1310494848
Serial Monitor Output: non printable junk character.
The value is incorrect, I am pretty sure, what am I doing wrong?
I found that the ITEAD shield is sending or rather using RX0/TX0 pins very frequently—some data is going through.
BTW what is the functionality of http://arduino.cc/en/Tutorial/SoftwareSerialExample?
How can I use 3 different Serial I/Os individually at the same time without disturbing any other I/O?