// LCD1602 and Pi Pico!
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 10, 9, 8, 7);
int buttonPin = 17;
int defaultValue = HIGH; // Pin 17 defaults to HIGH
void setup() {
lcd.begin(16, 2);
lcd.print("PRESS BUTTON");
pinMode(buttonPin, INPUT_PULLUP);
}
void loop() {
int newValue = digitalRead(buttonPin);
if (newValue != defaultValue)
{
if (newValue == LOW)
{
lcd.setCursor(2, 1);
lcd.print(">HI BRIANNA<");
Serial.println("Button Pressed");
Serial.println(newValue);
}
else
{
lcd.clear();
lcd.print("PRESS BUTTON");
Serial.println("Button Released");
Serial.println(newValue);
}
defaultValue = newValue;
}
}