OK, the area I am not clear on now is how to hook this LCD up and send a simple test message, the MEGA I have on order is this one (it hasnet arrived yet), I cant see an IIC bus...?
Shift registers add little complexity.
Use four TPIC6C595 or 6B595. Shift out 4 bytes with only 1 low output.
Use four 74HC165 to shift in 4 bytes with pullup resistors on the inputs. Check that the data shifted out matches the data shifted in.
If a line is open, you won't see a low.
If a line is shorted, you'll see two lows.
TPIC parts are open drain outputs, so a low output shorted to another pin won't hurt anything by driving against an active high output; it will just pull another pullup resistor low.
CrossRoads:
Shift registers add little complexity.
Yea, I do remeber (vaguely) learning about them, just have never had to use them. For this application I agree they probably are easier than a microcontroller but its the Arduino I want to play with, this is just starting a project, there will be many more to come...
dudester:
Thanks for the tip but to be honest, this is kind of an excuse to learn Arduino...
Shift registers might come in extraordinarily handy for you, and you wouldn't necessarily need a Mega.
this add a huge layer of learning. a MEGA would be simple pin by pin
then go for the learning... use a shift register and an UNO.
That display does not include a serial adapter. In my opinion its wrong of the supplier to show a picture of a product that is displaying "i2c" when no adapter is included in the price. If you buy that item without the adapter, you will need to connect it to 6 or 7 ordinary digital pins, not the i2c pins.
PaulRB:
That display does not include a serial adapter. In my opinion its wrong of the supplier to show a picture of a product that is displaying "i2c" when no adapter is included in the price. If you buy that item without the adapter, you will need to connect it to 6 or 7 ordinary digital pins, not the i2c pins.
dudester:
Yea, I do remeber (vaguely) learning about them, just have never had to use them. For this application I agree they probably are easier than a microcontroller but its the Arduino I want to play with, this is just starting a project, there will be many more to come...
The only reason I mentioned the shift registers is that there's always v2.0 of everything creeping around in the back of my mind. Whereas you'll quickly run out of pins on any microcontroller, shift registers can be daisy chained and therefore scale fantastically with your project should the need arise.
As for playing with the Arduino, the shift registers won't do the work for you. They'll just provide another sort of interface. You'll still need to manage the data just like you would using the I/O pins as discretes.
dudester:
Thanks, that looks simple to connect, will try one and give it a go.
I've never used that vendor, but the thing I liked about their listing was that they give a sample sketch, rather than leaving the buyer to figure out how to use it. Here is the first few lines:
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2); //set the LCD address to 0x27 for a 16 chars and 2 line display
What this shows is that a different/special version of the LiquidCrystal library is needed, and they give you the "constructor", which can be tricky to work out by yourself. (As opposed to the one I bought from a different vendor, who gave no sample sketch and I had to start a new thread on the forum to ask for help getting it working, which involved using a clever sketch written by a forum member which guesses the constructor until it gets it right).
Once you have the right constructor, sketches written for the standard LiquidCrystal library should work identically.
PaulRB:
the thing I liked about their listing was that they give a sample sketch, rather than leaving the buyer to figure out how to use it. Here is the first few lines:
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2); //set the LCD address to 0x27 for a 16 chars and 2 line display
When you say sketch are you referring to the code sample? (Sketch to me is a circuit diagram)
So, how do I use it as 4 rows of 20 ? As that is what I was looking for...
Do we simply set it to LiquidCrystal_I2C lcd(0x27,20,4);
The other term you are using is 'constructor', what exactly is that?
dudester:
When you say sketch are you referring to the code sample? (Sketch to me is a circuit diagram)
Welcome to the world of Arduino, where your code is called a sketch. Perhaps is was meant to sound less intimidating to artists, musicians etc,
dudester:
So, how do I use it as 4 rows of 20 ? As that is what I was looking for...
Do we simply set it to LiquidCrystal_I2C lcd(0x27,20,4);
Yes I think so.
dudester:
The other term you are using is 'constructor', what exactly is that?
An object-oriented-programming term. Its a function that makes a new object of a particular class, and optionally passes some parameters to it. In this case the object in question represents the display inside the program... I mean sketch...
Hi dudester, did you ever manage to create this wiring tester, its exactly what I'm trying to create now. I have a custom wiring harness that needs to be checked regularly between uses for open and short circuits. What you have said here is exactly what i was planning to build.