Hello,
I'm just start "playing" with arduino UNO water flow project.
So far I got the water flow sensor to work and to display on the serial monitor.
The problem is when I try to display on LCD. If I enable lcd.print() (see code), it stops to display on serial monitor and it doesn't update the LCD. Can someone help me?
float volume; //Variável para armazenar o valor Litros
int contaPulso; //Variável para a quantidade de pulsos
int i=0; //Variável para contagem
#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
void setup()
{
Serial.begin(9600);
pinMode(2, INPUT);
attachInterrupt(0, incpulso, RISING);
Serial.println("\n\nInicio\n\n");
lcd.init();
lcd.backlight();
}
void loop ()
{
contaPulso = 0;
sei();
delay (1000);
cli();
volume = ((contaPulso/5.5)/60+volume);
i++;
Serial.print(volume);
Serial.println(" Litros ");
lcd.print(volume);
}
void incpulso ()
{
contaPulso++;
}
Sorry for the bad English and silly question!!
Best Sylvio