I have an arduino uno can connected it to the Mini RS232 to TTL (https://www.amazon.co.uk/gp/product/B07XM6RNZG/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1 ). This is the code i used and i know that it works as i tried it this a DollaTek MAX3232 (https://www.amazon.co.uk/gp/product/B07DK3874B/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1 ).
Does anyone know what i have done wrong?
#include <SoftwareSerial.h>
SoftwareSerial TV_Serial(0, 1); // Arduino RX, Arduino TX
void setup() {
TV_Serial.begin(9600); // software serial port
}
void loop() {
String cmd = ("ka 01 01");
TV_Serial.println (cmd);
delay(5000);
}
pert
March 4, 2020, 8:12pm
2
Pins 0 and 1 on your Arduino Uno are used for communication with the computer, so it's best not to use them for anything else. If you are going to use them, it makes no sense to use SoftwareSerial library because those pins already have hardware serial capabilities. My advice is to connect your RS232 adapter to any other two free pins on your Uno and then update your code accordingly.
This is the updated code now but it still did not work.
#include <SoftwareSerial.h>
SoftwareSerial TV_Serial(0, 1); // Arduino RX, Arduino TX
void setup() {
TV_Serial.begin(9600); // software serial port
}
void loop() {
String cmd = ("ka 01 01");
TV_Serial.println (cmd);
delay(5000);
}
pert
March 5, 2020, 10:50am
4
Why are you still using pins 0 and 1?
Sorry forgotten to update it.
#include <SoftwareSerial.h>
SoftwareSerial TV_Serial(5, 6); // Arduino RX, Arduino TX
void setup() {
TV_Serial.begin(9600); // software serial port
}
void loop() {
String cmd = ("ka 01 01");
TV_Serial.println (cmd);
delay(5000);
}