Skip to content

Instantly share code, notes, and snippets.

@maxpromer
Created October 31, 2025 02:14
Show Gist options
  • Save maxpromer/e1a090b733becfb529d1577b3c217ee6 to your computer and use it in GitHub Desktop.
Save maxpromer/e1a090b733becfb529d1577b3c217ee6 to your computer and use it in GitHub Desktop.
#include <Wire.h>
#include <Adafruit_GFX.h>
#include "Adafruit_LEDBackpack.h"
// สร้างออบเจ็กต์จอ 7-Segment
Adafruit_7segment matrix = Adafruit_7segment();
void setup() {
Serial.begin(9600);
Serial.println("7-Segment Test");
// เริ่มต้นจอที่ Address 0x70
matrix.begin(0x70);
// ตั้งค่าความสว่าง (0-15)
matrix.setBrightness(10);
// เคลียร์จอ
matrix.clear();
matrix.writeDisplay();
}
void loop() {
// นับเลขจาก 0 ถึง 9999
for (int i = 0; i <= 9999; i++) {
matrix.print(i);
matrix.writeDisplay();
delay(100);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment