Well not quite blinking in the real sense more like a pulse I have been building up my code and it's working and all has been good - learning quite a bit but I'm stuck on this one, the LCD (16x2 I2C 4 wire) is pulsing and I'm not quite sure it's the code I've looked but the led's on the uno are not pulsing but the LCD is albeit faint but annoying any ideas? I have 3 led's to the 3 data pins for both looks and debugging they do not pulse I've tried power from the board as well as from my bench top power supply
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal_I2C lcd(0x27, 16, 2);
int senpin = A0;
void setup()
{
lcd.init(); //initialize the lcd
lcd.backlight(); //open the backlight
lcd.begin(16, 2); // set up the LCD's number of columns and rows:
lcd.clear();
pinMode(A0, INPUT); //set up analog pin A1 to be input
pinMode(2, OUTPUT); // red led
pinMode(3, OUTPUT); // yellow led
pinMode(4, OUTPUT); // green led
}
void loop()
{
lcd.setCursor(0, 0); // Sets the cursor to col 0 and row 0
lcd.print(analogRead(A0)); // Prints value on senpin A0 to LCD
int senpin = analogRead(A0); //take a sample
if (senpin < 370 && senpin >= 0) {
lcd.clear();
lcd.setCursor(4, 0);
lcd.print("Low water");
lcd.setCursor(3, 1);
lcd.print("Near death!");
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
}
if (senpin < 600 && senpin >= 370) {
lcd.clear();
lcd.setCursor(5, 0);
lcd.print("I need");
lcd.setCursor(1, 1);
lcd.print("A little more!");
digitalWrite(2, LOW);
digitalWrite(3, HIGH);
digitalWrite(4, LOW);
}
if (senpin < 1000 && senpin >= 600) {
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("That's enough");
lcd.setCursor(1, 1);
lcd.print("I'm drowning!");
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, HIGH);
}
{
delay (1000);
}
}