// Define the GPIO pins for the LEDs
const int redPin = 27;
const int yellowPin = 26;
const int greenPin = 25;
void setup() {
// Initialize the serial monitor
Serial.begin(115200);
// Set the LED pins as OUTPUT
pinMode(redPin, OUTPUT);
pinMode(yellowPin, OUTPUT);
pinMode(greenPin, OUTPUT);
}
void loop() {
// Red light ON, Green and Yellow OFF
digitalWrite(greenPin, LOW);
digitalWrite(yellowPin, LOW);
digitalWrite(redPin, HIGH);
Serial.println("ruk re g...");
delay(30000); // Red light for 5 seconds
// Yellow light ON, Green and Red OFF
digitalWrite(yellowPin, HIGH);
digitalWrite(redPin, LOW);
Serial.println("readyfor fu...");
delay(20000); // Yellow light for 2 seconds
// Green light ON, Red and Yellow OFF
digitalWrite(greenPin, HIGH);
digitalWrite(redPin, LOW);
digitalWrite(yellowPin, LOW);
Serial.println("nikal re l....");
delay(15000); // Green light for 5 seconds
}
#include <Adafruit_GFX.h>
#include <Max72xxPanel.h>
// Pin configuration for the LED Matrix
#define DATA_PIN 23
#define CLOCK_PIN 18
#define LOAD_PIN 5
#define MAX_DEVICES 1 // Number of 8x8 matrices connected
// Create an object for the MAX72xx panel
Max72xxPanel matrix = Max72xxPanel(DATA_PIN, CLOCK_PIN, LOAD_PIN, MAX_DEVICES);
void setup() {
matrix.setIntensity(5); // Set brightness (0 to 15)
matrix.setRotation(0); // Set rotation (0, 90, 180, 270)
matrix.fillScreen(LOW); // Clear the screen (fill with black)
}
void loop() {
matrix.fillScreen(LOW); // Clear the screen
matrix.setCursor(0, 0); // Start drawing from the top left corner
// Display "HELLO" using a built-in font
matrix.print("HELLO");
// Scroll the message across the screen
matrix.write(); // Update the matrix
delay(200); // Add a delay for better readability
}