Skip to content

Instantly share code, notes, and snippets.

@maxpromer
Created October 31, 2025 02:34
Show Gist options
  • Save maxpromer/20df2057edf84214ea3adda892be466a to your computer and use it in GitHub Desktop.
Save maxpromer/20df2057edf84214ea3adda892be466a to your computer and use it in GitHub Desktop.
#include <Wire.h>
#include <Adafruit_GFX.h>
#include "Adafruit_LEDBackpack.h"
Adafruit_7segment matrix = Adafruit_7segment();
float temperature = 25.5;
void setup() {
matrix.begin(0x70);
matrix.setBrightness(12);
}
void loop() {
// แสดงอุณหภูมิแบบทศนิยม 1 ตำแหน่ง
matrix.print(temperature, 1);
matrix.writeDisplay();
// จำลองการเปลี่ยนแปลงอุณหภูมิ
temperature += 0.1;
if (temperature > 99.9) {
temperature = 0.0;
}
delay(500);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment