Hello,
I understand this topic has been covered in many different situations, but I cannot find the right case (or at least I haven't so far). I really need a clue on this.
I have the RS232 shield ( this one ) connected to arduino UNO and I am trying to send simple commands to a player via RS232 cable.
After several tries and many copy/paste from this forum I came to this situation:
I only get a sequence of numbers from the serial monitor but nothing happens on the player
I am sure the HEX sequence of the command is correct (the format from the manual is attached) but still I don't get any result.
What's my mistake?
Thank You sir!
Actually your answer saved me. Since I got no errors I supposed the method was correct. To keep it simple I skipped the external function and it worked.
The code to send the array of hex with the mentioned shield is
#include <SoftwareSerial.h>
#define rx 2 //define what pin rx is going to be
#define tx 3 //define what pin tx is going to be
SoftwareSerial mySerial(rx, tx); //232_TX,232_RX
byte Play[] = {0x86, 0x00, 0x00, 0x02, 0x00, 0x44};
byte Stop[] = {0x86, 0x00, 0x00, 0x00, 0x00, 0x52};
void setup() {
mySerial.begin(9600);
Serial.begin(9600);
}
void loop() {
for (int i = 0; i < 255; i++) {
mySerial.write(Play, 6);
}
delay(2000);
for (int i = 0; i < 255; i++) {
mySerial.write(Stop, 6);
}
delay(2000);
}