Help with rs232 communication. Can anybody help me with a simple project?
I have a rfid reader connected to arduiono Leonardo and i need to do it simple translator.
The function is:
If arrive data on software serial port(always is it 16 byte string - transponder ID) and data separator is FormFeed / 12 / FF
i need to print thouse data and send to serial (to computer) in this format:
ABCD+TRANSPONDER ID.
TRANSPONDER ID(IN HEX FORMAT)
ABCD is a four charcter constant.
i dont know how to do it. I thing it can be:
#include <SoftwareSerial.h>
/*
- Sketch10.ino
- Created: 8/2/2015 2:53:06 PM
- Author: USER8
*/
SoftwareSerial mySerial(10, 11); // RX, TX
#include "MyClass.h"
void setup()
{ myClass.setup();
mySerial.begin (9600);
while (!mySerial);
}
void loop()
{
String Separator=F;
String AB=mySerial.readStringUntil (Separator);
myClass.loop();
mySerial.readBytesUntil (Separator,AB,16);
}