Experimentalist
Well-known member
Hi
I have 2 current hardware versions of a project I am building, both use Teensy 3.0. One uses a tri-colour LED for indication the other a 16 character LCD. I was wondering if anyone has any idea how I can detect if the LCD is connected and so disable the redundant code based on this.
If possible I want to do this without wasting any pins. I realise I could connect a digital pin and use this but it would be nicer if I could detect the LCD.
My code inits the LCD as follows, using 7 pins and the LiquidCrystalFast library.
// LiquidCrystalFast lcd(RS, RW, Enable, D4, D5, D6, D7)
LiquidCrystalFast lcd(22, 23, 6, 7, 8, 9, 10);
Anyone got any ideas?
Ta
Ex.
I have 2 current hardware versions of a project I am building, both use Teensy 3.0. One uses a tri-colour LED for indication the other a 16 character LCD. I was wondering if anyone has any idea how I can detect if the LCD is connected and so disable the redundant code based on this.
If possible I want to do this without wasting any pins. I realise I could connect a digital pin and use this but it would be nicer if I could detect the LCD.
My code inits the LCD as follows, using 7 pins and the LiquidCrystalFast library.
// LiquidCrystalFast lcd(RS, RW, Enable, D4, D5, D6, D7)
LiquidCrystalFast lcd(22, 23, 6, 7, 8, 9, 10);
Anyone got any ideas?
Ta
Ex.
Last edited: