Hi guys I was wondering if it is possible to use to LCD to display what I want using one Arduino board. as you can see my problem is the number of pins available and I was wondering if i can still used the pins that I used for my first LCD to my 2nd LCD
...and I was wondering if i can still used the pins that I used for my first LCD to my 2nd LCD
You can 'double-up' on all of the pins except 'E'.
Check this out (scroll down): http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1265969050
Don
There are also I2C displays and serial displays that can share pins and be addressed. That will reduce pin count of parallel connection from 6 to 2.
Especially the Parallax Serial display. 5 volts, ground and one pin to transmit what you want it to say. It's much easier.
Especially the Parallax Serial display...
Parallax has more than one serial display. The ones that I found seem to use an RS232 type protocol at TTL voltage levels. How would you easily deal with driving more than one of them?
Don
TTL logic is what the Arduino is putting out on the pins (0-5 volts) so that part should be easy. I haven't the funds yet to buy a second serial LCD yet so I haven't had the chance to play with two "output" devices. My the code I'm working on for a bike computer is using an RFID input and a serial LCD output so I'm posting the code so you can get an idea of how to start working with multiple serial ports.
I have a Seeeduino BT shield so that will explain the use of D8/D9 for the RFID.
This is still a work in progress.
/*
This is going to be my PeddleCart computer with:
RFID reader
* to allow certain "tag" holders to operate
* maybe speed control
Serial LCD
* display GPS info and other data
Bluetooth module
* to work as the RFID reader but to detect my phone
to allow opration
=================
to RFID reader working
Vcc to 5vdc
/Enable to D8
SOUT to D9
Gnd to GND
=================
to Serial LCD working
Vcc to 5vdc
Gnd to GND
Rx to D7
*/
#include <SoftwareSerial.h>
int val = 0; // RFID
char code[10]; // RFID
int bytesread = 0; // RFID
int loc = 0; // SLCD
#define rxRFID 9 // RFID data to Arduino
#define txRFID 255 // RFID (not needed)
#define enRFID 8 // RFID Enable from Arduino
#define rxSLCD 255 // SLCD (not needed)
#define txSLCD 7 // SLCD data from Arduino
String symDegree, symRArrow, symLArrow, beep, RFIDready;
SoftwareSerial RFID = SoftwareSerial(rxRFID,txRFID);
SoftwareSerial SLCD = SoftwareSerial(rxSLCD,txSLCD);
void setup()
{
pinMode(enRFID,OUTPUT);
pinMode(txSLCD,OUTPUT);
digitalWrite(enRFID, LOW);
digitalWrite(txSLCD, HIGH);
Serial.begin(9600); // output to computer
SLCD.begin(2400); // output to LCD
RFID.begin(2400); // the port being "Listen" to is started last
GPS.begin(4800); // (yea, how am I gonna work this?)
char symUnd_0_[9] = {248, 0, 0, 0, 0, 0, 0, 0, 0}; // defined char 0
char symDegree[9] = {249, 12, 18, 18, 12, 32, 32, 32, 32}; // defined char 1
char symRArrow[9] = {250, 16, 24, 28, 30, 28, 24, 16, 32}; // defined char 2
char symLArrow[9] = {251, 1, 3, 7, 15, 7, 3, 1, 32}; // defined char 3
char symUnd_4_[9] = {252, 12, 18, 18, 12, 32, 32, 32, 32}; // defined char 4
char symUnd_5_[9] = {253, 16, 24, 28, 30, 28, 24, 16, 32}; // defined char 5
char symUnd_6_[9] = {254, 1, 3, 7, 15, 7, 3, 1, 32}; // defined char 6
char symUnd_7_[9] = {255, 12, 18, 18, 12, 32, 32, 32, 32}; // defined char 7
char beep[3] = {209, 219, 220}; // short beep sound
RFIDready = "Ready to start";
SLCD.write(symDegree); // upload defined char(1) to the LCD
SLCD.write(symRArrow); // upload defined char(2) to the LCD
SLCD.write(symLArrow); // upload defined char(3) to the LCD
SLCD.write(12); // clear screen
SLCD.write(22); // disp on/curs off/blnk off
/*
SLCD.write(2);
SLCD.print(" It is 85");
SLCD.write(1); // hopefully a degree symbol
SLCD.write(3);
SLCD.write(209); // 1/32 note
SLCD.write(219); // 7th octave
SLCD.write(220); // A tone
*/
SLCD.print(beep);
SLCD.println(RFIDready);
delay(3000); // Wait 3 seconds
SLCD.write(12);
}
void loop()
{
//SLCD.write(128);
//SLCD.print("Reading...");
if((val = RFID.read()) == 10) // check for header
{
bytesread = 0;
while(bytesread<10)
{ // read 10 digit code
val = RFID.read();
loc = 148 + bytesread;
SLCD.write(loc);
SLCD.print(val);
if((val == 10)||(val == 13))
{ // if header or stop bytes before the 10 digit reading
break; // stop reading
SLCD.print("...error...");
}
code[bytesread] = val; // add the digit
bytesread++; // ready to read next digit
}
if(bytesread == 10)
{ // if 10 digit read is complete
Serial.println("TAG code is: "); // possibly a good TAG
//SLCD.println("TAG code is: "); // possibly a good TAG
Serial.println(code); // print the TAG code
SLCD.write(148); // print@ line 2 char 1
SLCD.print(code); // possibly a good TAG
SLCD.print(beep);
}
bytesread = 0;
delay(1000); // wait for a second
}
}
... so you can get an idea of how to start working with multiple serial ports.
Can you point out where you are using the same pins for both of the LCDs? That is the whole point of this thread.
Don
Like I said, there are some I2C LCDs that accept change of address.
For ordinary serial LCD, you may do two software serial ports each controlling one LCD.
By default, you can't connect multiple serial LCDs to one serial port and expect them to know which one is addressed. You need firmware support. I design and sell my phi-panel serial LCD backpack, which has firmware to support addressing up to 255 LCDs on one serial port. You start with enabling addressing on the LCDs and then declare which LCD to address and print to it.