Hello,
I am having some difficulty interfacing to a digital balance through its RS232, I am able to read the output of the scale on my laptop using hyperterminal so I assume it is not the serial output on the balance.
I am using an RS232 to TTL convertor that I got on ebay here is the link http://www.ebay.com/itm/150813151216?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649
I got two of the convertors.
I am using a Mega my UNO's are tied up in more permanent projects. In addition to connecting the ground on the convertor to the ground on the board and have plugged the TX and RX from the converter into TX0 and RX0 on the Mega. I have tried switching the TX and RX lines in case I the labels on the converter incorrectly to no avail. I tried setting the baud rate on the scale at 9600 and 1200, using the same rate when I began the serial connection in the sketch and this did no magic. To check for a faulty convertor I swapped out the converter and went through the same tests.
I checked the output of the scale's serial port using HyperTerminal at both 9600 and 1200 and all was good on that end. I have used this Mega to read the serial output of various ZigBees so I know that the Mega works when given good serial input and proper instructions from me.
The code I started with was more involved than the code below. I wrote the code below just to notify me if and when there was any activity observed on the serial line.
/*
If there is activity cycles the onboard LED
*/
void setup() {
pinMode(13, OUTPUT);
// initialize serial:
Serial.begin(1200); // Serial Monitor
}
void loop() {
// print the string when a newline arrives:
if(Serial.available()) {
// if there is activity flicker the onboard LED
for(int ij = 0;ij < 10;ij++)
{
digitalWrite(13, HIGH);
delay(100);
digitalWrite(13, LOW);
delay(100);
}
}
}
Does anyone have any hints as to what I am doing wrong or further troubleshooting I should do?
Thanks
wade