I need to visualize in an LCD while reasings rpm drom interrupt events, but the liquidcrystal library uses pins 2 and 3. I know there is a so called pinchangeint library but when compiling it remains doing so for long. I left it compiling for 30+ minutes to no avail. The library was correctly included. All other libs work ok.
I'm using IDE 1.6.4.
You should be able to move the lcd to any set of pins and and free up the external interrupt pins. Change the constructor(LiquidCrystal lcd(rs, en, d4, d5, d6, d7)to match the pins used.
cattledog:
You should be able to move the lcd to any set of pins and and free up the external interrupt pins. Change the constructor(LiquidCrystal lcd(rs, en, d4, d5, d6, d7)to match the pins used.
I'm sorry I don't know how to "change the constructor". What's that?
I'm sorry I don't know how to "change the constructor". What's that?
It's the initialization code which tells the Arduino which of its pins are connected to the pins of the display.
// initialize the library by associating any needed LCD interface pin
// with the arduino pin number it is connected to
const int rs = any pin, en = any pin, d4 = any pin , d5 = any pin, d6 = any pin, d7 = any pin;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
The circuit:
LCD RS pin to any pin
LCD Enable pin to any pin
LCD D4 pin to any pin
LCD D5 pin to any pin
LCD D6 pin to any pin
LCD D7 pin to any pin
LCD R/W pin to ground
LCD VSS pin to ground
LCD VCC pin to 5V
10K resistor:
ends to +5V and ground
wiper to LCD VO pin (pin 3)
Do not use Arduino pins 0 and 1 because they are best reserved for the Serial output and code download. The analog pins can also be used for digital I/O if you are short of pins.
Ok without knowing it as the constructor I know I have to use different pins for each parameter but will it work? All the examples use pin 2 and 3 at a specific connection.
Well I have been using it for long and worked fine...until I tried pinchangeint.
Ok I inatalled 1.8.5 and tried compiling the lirary to success. Anyway I found that after changing pin 2 to 6 the liqudcrystal lib works ok. So no need for changing interrupts pins. My tachometer works fine.