Matrix M4 Portal clock project and question

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
colonwq2
 
Posts: 11
Joined: Sat Feb 21, 2015 8:27 pm

Matrix M4 Portal clock project and question

Post by colonwq2 »

I got inspired by a Youtube video from Dave's Garage and wrote an analog clock display for the 64x32 LED display. This display works pretty well but I have a couple improvements I cant work out.

1) My board fails to connect to the wifi sometimes. I've adding some hackish code which will loop up to 3 times. I was wondering if there are better ideas.
2) My main event loop uses a sleep between display updates. There is a lot of flicker if the sleep is removed.
3) The get_local_time() function is very useful and saved lots of manual coding. Is there a list of cool/useful library functions?

Here is an obligatory picture of the clock.
Demo Shot
Demo Shot
clock-image-scaled.png (548.12 KiB) Viewed 164 times

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: Matrix M4 Portal clock project and question

Post by mikeysklar »

Cool clock.

Which version of CircuitPython are you running and what date for the library bundle?

Are you able to grab the network disconnect cause from the REPL console? It can be due to AP being unreachable, running out of sockets or DNS server timing out just to name a few reasons.

Code: Select all

        except ConnectionError as e:
            print("could not connect to AP, retrying: ", e)
            continue
to this:

Code: Select all

    except (ValueError, RuntimeError, ConnectionError, OSError) as e:
        print("Failed to get data, retrying...\n", e)
        continue
You generally need a sleep or delay of some type when updating the display so the LEDs stay on for a minimal enough time to not have a flicker effect. The display will be constantly redrawing without a sleep.

There might be some other helpful functions for you in the API Reference of the adafruit_matrixportal library.

https://docs.circuitpython.org/projects ... en/latest/

Locked
Please be positive and constructive with your questions and comments.

Return to “Itsy Bitsy Boards”