I am relatively new to programming and am trying to write a string from the Arduino uno to a device that contains the chip atmega168. I can send a command set by the manufacturer of 001mi. followed by carriage return in the arduino's serial monitor and even receive a response. Of course I am using a ttl converter. Here is the communication protocol from the manufacturer. The signaling is half duplex (party line) async like RS232, but with a different hardware interface. Undriven, (space), the two lines are between 10 and 15V apart, and driven, (mark) they are about 2V apart. There is no "ground" reference. One advantage of this is that you can use a normal terminal or terminal emulator program to talk to the Bus devices: 9600 Baud, 8 bits, no parity, 2 stop bits. I have heard there is no support for the 2 stop bits. Here is my start to the program. Can someone steer me in the right direction? I know I don't have the concept of strings. #include <SoftwareSerial.h> #define RX_PIN = 0 #define TX_PIN = 1
int x = 0;
void setup()
{
Serial.begin(9600); //Serial1.begin(9600);
}
void loop()
{
// Serial1.write("0011.\n");
Serial.write ("001l.\n"); //use 001l. followed by a carriagre return
Serial.println(001l.
//int bytesSent = Serial.write("
delay(500);
if (Serial.available()) {
int inByte = Serial.read();
Serial.print("001l.");
Serial.print("\n"); //Serial.end(9600);
I am wanting to send a command to a device using a serial connection. The manufacturer gave me this about the setup. The signaling is half duplex (party line) async like RS232, but with a different hardware interface. I previously sent you a schematic of the interface. Undriven, (space), the two lines are between 10 and 15V apart, and driven, (mark) they are about 2V apart. There is no "ground" reference. One advantage of this is that you can use a normal terminal or terminal emulator program to talk to the devices: 9600 Baud, 8 bits, no parity, 2 stop bits. The command is 01l. The manufacturer also states I need a carriage return at the end. I assume \r. What would be a simple program for this using an arduino uno?