I'm using LedControl library to control a 4 digit LED unit to display temperature captured from a Dallas 18B20 sensor. I've gotten enough to do this pretty good. I can create a LedControl variable with the pins used to control the LED unit:LedControl lc=LedControl(12,11,10,1)
arduino pin 12 is Datain
arduino pin 11 is CLK
arduino pin 10 is LOAD or CS
fourth arg indicates only one display is in use
Now I've got two of these displays and I'd like to use them both. I'm using a BMP085 sensor which gives pressure and temperature ouput. I want to display the temp on one display and the pressure on the other. I can't figure out from the LedControl online reference how to set this up.
Do I have to use a different variable in the declaration statement? In my statement
above "lc" is the variable declared to be LedControl. To setup a second display with different pins do I have to use a different variable?
It doesn't make sense since the statements used in the library to control the displays all seem to have a argument to select which display they are operating on.
Or...... do you simply add the additional pins in the LedControl declaration statement?
LedControl lc=LedControl(12,11,10, 9, 8, 7, 2);
9, 8, 7 being the arduino pins connected to the second display and the last arg "2" being the number of displays.
Wouldn't appear so as the compiler complains there are too many args.LedControl lc=LedControl(12,11,10,2);
This will get past the compiler but then I have to use either the lc variable or the lc1 variable depending on which display I want a command to operate on. This makes no sense when almost all the commands contain an argument specifying which display to operate on. Darn, I'm repeating myself! I wish there were a better explanation of how to use the neat library.
A little sunshine on this subject would sure cheer me up.