Hello everyone! Coming back after years so very unfamiliar with this. Just copying and pasting and learning how to use codes again. Copied a code courtesy of Zaidi Mat Nawi from YouTube that prints out potentiometer values onto an lcd screen. I am trying to change the top (0,0) lcd screen to print out 'if/then' statements.
Example, if the potentiometer reads 300 < ohms, LCD prints 'low', if 301-600 ohms - LCD prints 'Medium', and if 601 > ohms, LCD prints 'high'.
Any help/steps would be greatly appreciated!
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
int val = 0;
void setup()
{
lcd.init();
lcd.backlight();
lcd.clear();
}
void loop()
{
val = analogRead(A0);
lcd.setCursor(0,0);
lcd.print("Potentiometer: ");
lcd.setCursor(0,1);
lcd.print(val);
delay(100);
lcd.clear();
}