O Level Exam : Practical Question
📝 HTML
🎨 CSS
⚡ Java Script
#include <LiquidCrystal.h> // RS, E, D4, D5, D6, D7 pins of LCD connected to Arduino LiquidCrystal lcd(12, 11, 5, 4, 3, 2); void setup() { lcd.begin(16, 2); // Initialize 16x2 LCD lcd.print("Hello World!"); } void loop() { lcd.setCursor(0, 1); // Move cursor to second row lcd.print("Time: "); lcd.print(millis() / 1000); // Time in seconds lcd.print(" sec"); delay(1000); // Update every second }
▶ Run Code
🖥 Output: