aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorD Delmar Davis <don@suspectdevices.com>2025-06-22 10:10:18 -0700
committerD Delmar Davis <don@suspectdevices.com>2025-06-22 10:10:18 -0700
commit166a361d8bbcc8992472681a7e23775ef38657a3 (patch)
tree84d7e3942cbc6b405dfbb9b8f98e2865dc7dc258
parentf7172dbb6438cb60cc781377410f9b6ac6a6250f (diff)
whats the time?
-rw-r--r--bin/timetemp.py35
1 files changed, 5 insertions, 30 deletions
diff --git a/bin/timetemp.py b/bin/timetemp.py
index 39791d2..7b03421 100644
--- a/bin/timetemp.py
+++ b/bin/timetemp.py
@@ -1,5 +1,5 @@
-# SPDX-FileCopyrightText: 2019 Mikey Sklar for Adafruit Industries
-#
+#!/usr/bin/python
+# References : SPDX-FileCopyrightText: 2019 Mikey Sklar for Adafruit Industries
# SPDX-License-Identifier: MIT
import time
@@ -16,31 +16,6 @@ display = segments.Seg7x4(i2c)
# Clear the display.
display.fill(0)
-
-# Can just print a number
-display.print(42)
-time.sleep(1)
-
-# Set the first character to '1':
-display[0] = '1'
-# Set the second character to '2':
-display[1] = '2'
-# Set the third character to 'A':
-display[2] = 'A'
-# Set the forth character to 'B':
-display[3] = 'B'
-time.sleep(1)
-
-numbers = [0.0, 1.0, 0.55, 10.23, 100.5]
-
-# print floating point numbers
-for i in numbers:
- display.print(str(i))
- time.sleep(0.5)
-
-# print hex values, enable colon
-for i in range(0xFF):
- display.fill(0)
- display.print(':')
- display.print(hex(i))
- time.sleep(0.25)
+while True:
+ display.print(time.strftime("%H:%M"))
+ time.sleep(59.9) \ No newline at end of file