Hello.
I am having touble communicate with a keypad/Mifare reader via Serial.
This is the documentation for the keypad:
LED/Buzzer command set frame as below:
STX J NUMBER (0~9) CR
02h 4Ah 30h~39h 0Dh
Command Table:
NUMBER Descriptions
0 (30h) All LED Off, Buzzer Off
1 (31h) Green LED ON
2 (32h) Green LED OFF
3 (33h) Red LED ON
4 (34h) Red LED OFF
5 (35h) Buzzer Beep 1 Time
6 (36h) Buzzer Beep 3 Time
7 (37h) Green LED ON with Beep 1 Time
8 (38h) Red LED ON with Beep 3 Time
9 (39h) All LED ON (Orange)
I can successfully receive data from the keypad so it is no problem with the connection but I don't know how to send this data.
If I connect the Keypad to my computer via TTL/RS232 converter to my Serialport I successfully sends command like this with Visual Studio:
Byte Buffer() = {&H2, &H4A, &H37, &HD};
SerialPort1.Write(Buffer, 0, 4); //Green LED ON with Beep 1 Time
The reader responds to this so it is okay but how do I send this from Arduino?
I have tried but with no success:
char b[4] = {0x02, 0x4A, 0x37,0x0D};
Serial1.print(b);
Regards
Daniel