- Thu Aug 02, 2007 3:50 pm
#33249
Has anyone tried interfacing an Arduino NG board with a DX-160 Serial LCD from SF? The screen comes on and shows the startup screen, but I can't seem to get any command to work except the clear screen command (186).
I've done programming on a PC before, but I'm a complete newbie when it comes to microcontrollers, etc. I have done some simple stuff with the Arduino and LED's and serial communication to the PC, but this was going to be the next "step" in learning about this kind of thing.
I'm sure there is something extremely simple that I'm missing. I've spent some time on Google looking up information on this particular combination, but as far as I can tell I'm the first. And I've looked at other code for other serial screens, but I still can't tell what I'm doing wrong.
Here's some sample code (I've got the board powered by USB, an LED connected to pin 13, and the tx pin on the board connected to TTL on the screen. By the way, I can see the commands in the IDE with the serial monitor on. I had thought that the board was sending commands over USB and not out tx, so I powered it using a wall wart, but this did not fix anything.):
I've done programming on a PC before, but I'm a complete newbie when it comes to microcontrollers, etc. I have done some simple stuff with the Arduino and LED's and serial communication to the PC, but this was going to be the next "step" in learning about this kind of thing.
I'm sure there is something extremely simple that I'm missing. I've spent some time on Google looking up information on this particular combination, but as far as I can tell I'm the first. And I've looked at other code for other serial screens, but I still can't tell what I'm doing wrong.
Here's some sample code (I've got the board powered by USB, an LED connected to pin 13, and the tx pin on the board connected to TTL on the screen. By the way, I can see the commands in the IDE with the serial monitor on. I had thought that the board was sending commands over USB and not out tx, so I powered it using a wall wart, but this did not fix anything.):
Code: Select all
int ledPin = 13; // select the pin for the LED
void setup() {
pinMode(ledPin,OUTPUT); // declare the LED's pin as output
Serial.begin(57600); // connect to the serial port
}
void loop () {
Serial.print(185,BYTE);
Serial.print(186,BYTE);
Serial.print(180,BYTE);
Serial.print("Hello, world!");
Serial.print(255,BYTE);
Serial.print(181,BYTE);
Serial.print("Hello, world!");
Serial.print(255,BYTE);
digitalWrite(ledPin, LOW);
delay(10000);
Serial.print(185,BYTE);
digitalWrite(ledPin, HIGH);
delay(10000);
}