ARDUINO 2

PHOTO EMBED

Mon Jan 08 2024 23:10:01 GMT+0000 (Coordinated Universal Time)

Saved by @马丽

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2); // Set up the LCD pins

const int led = 13; // Green LED connection to digital pin 13
const int led1 = 6; // Red LED connection to digital pin 6

byte leds = 0;

void setup() {
lcd.begin(16, 2); // Initialize the LCD screen
pinMode(led, OUTPUT);
pinMode(led1, OUTPUT);
}
void loop() {
// Turn on the Green LED and display message "NOVVA ON!"
digitalWrite(led, HIGH);
digitalWrite(led1, LOW);
lcd.setCursor(0, 0);
lcd.print(" NOVVA ON");
delay(2000); // Delay for 2 seconds

// Turn on the Red LED and display message "NOVVA OFF!"
digitalWrite(led, LOW);
digitalWrite(led1, HIGH);
lcd.clear(); // Clear the LCD Display
lcd.setCursor(0, 0);
lcd.print(" NOVVA OFF!");

delay(2000); // Delay for 2 seconds
}
content_copyCOPY