Problem: Arduino Uno + Ultra Compact RS232 to TTL Converter -> Projector-Control


hello ladies , gentleman,

i looking answer of problem. want control nec beamer arduino - power on / off. bought rs232 ttl converter @ amazon , connected arduino. seems doesn't works. don't know why.

i tested usb-rs232-adapter , coolterm osx , sended hex-string "02 00 00 00 00 02" power on , "02 01 00 00 00 03" power off - works (send_data_usbadapter_to_projector _ works).

when connect arduino on rs232 rs232-usb-adapter, receives data in attachment (send_data_arduino_to_usbadapter.png): 200002200002200002

because loop, see arduino-code:

quote
#include <softwareserial.h>

const int rx = 10; // rx pin of arduino, so(serial out)of trex.
const int tx = 11; // tx pin of arduino, si(serial in)of trex.

softwareserial myserial (rx, tx); // rx of trex, tx si of trex

void setup() {
 serial.begin(9600);
 myserial.begin(9600);
 

}

void loop() {

 delay(1000);
 myserial.print(0x02,hex);
 myserial.print(0x00,hex);
 myserial.print(0x00,hex);
 myserial.print(0x00,hex);
 myserial.print(0x00,hex);
 myserial.print(0x02,hex);

 delay(1000);
 
 if (myserial.peek() == -1) {
   serial.println("no response");
 }
 while (myserial.peek() != -1) {
   serial.println(myserial.read());
 }
}
i tested serial.print , rx, tx-pins, doesn't work to.


who knows problem , me? :)


best regards
benni

i tested:


void setup() {
  serial.begin(9600);
}

void loop() {

  delay(1000);

  serial.write(0x02);
  serial.write(0x00);
  serial.write(0x00);
  serial.write(0x00);
  serial.write(0x00);
  serial.write(0x02);

  delay(1000);
 
}

------

void setup() {
  serial.begin(9600);
}

void loop() {

  delay(1000);

  serial.write(02);
  serial.write(00);
  serial.write(00);
  serial.write(00);
  serial.write(00);
  serial.write(02);

  delay(1000);
 
}

------

void setup() {
  serial.begin(9600);
}

void loop() {

  delay(1000);

  serial.write("02 00 00 00 00 02);


  delay(1000);
 
}


Arduino Forum > Using Arduino > Microcontrollers > Problem: Arduino Uno + Ultra Compact RS232 to TTL Converter -> Projector-Control


arduino

Comments

Popular posts from this blog

Error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode - Raspberry Pi Forums

class MPU6050 has no member named begin

missing filename after '-o'