Created
October 31, 2025 02:34
-
-
Save maxpromer/20df2057edf84214ea3adda892be466a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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