Hallo anybody,
i have experimented with my new esp8266 (Lolin V3) and a 8Dig 7 Segment Modul (Max7219).
Its worked fine!
But i found only Demo scripts with blinking and so.
I need a simple code for a Time Clock a' la "H - M - S"
I have also experimented with raspberry pi and there i have a solution!
But is it in PYTHON and i dont want raspi.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Richard Hull and contributors
import time
from datetime import datetime
from luma.led_matrix.device import max7219
from luma.core.interface.serial import spi, noop
from luma.core.virtual import viewport, sevensegment
def clock(seg):
interval = 0.5
for format in cycle(["%H-%M-%S", "%H %M %S"]):
now = datetime.now()
seg.text = now.strftime(format)
time.sleep(interval)
def main():
# create seven segment device
serial = spi(port=0, device=0, gpio=noop())
device = max7219(serial, cascaded=1)
seg = sevensegment(device)
# Digit futzing
clock(seg)
if __name__ == '__main__':
main()
Can anybody help me please. And sorry for my bad english.
Thanks