Categories
CircuitPython Microcontroller Software Development

PyPortal Event Countdown Clock Mods III

Some big updates to the software for the modified PyPortal Event Countdown Clock. The UI was changed and several features added. It also seems to be more stable as it does not lock-up randomly. Let’s get into the changes.

  • Header and Footer status bars display information
    • Header
      • Temperature
        • Touch to change between Fahrenheit and Celsius
      • Time
        • Touch to change between 24 hour and 12 hour formats
      • Network Strength
    • Footer
      • Brightness
        • Touching the left side of the footer, dims the display backlight
        • Touching the right side of the footer, increases the brightness of the display backlight
        • Touching the middle of the footer, returns to auto brightness of the display backlight
      • Event of the number of events
  • Change the event displayed by touching the left of the display to show previous event or the right side to advance to the next event.
  • If an event has passed more than a day ago, they will be removed from the list of events and no longer displayed
  • The events do not need to be in order in the JSON file. They are sorted when they are loaded from the SD Card with the soonest event being displayed first.
Demo of the PyPortal Event Countdown Clock Mods

Noticed that the temperature was several degrees too high. This was due to the ADT7410 being too close to devices generating heat. I removed the ADT7410 and placed it on a small board and added a PH2 JST connector so it may be plugged into the I2C socket. This resulted in much more usable temperature reading.

PyPortal Event Countdown with temperature sensor moved off the PyPortal
ADT7410 Temperature Sensor moved to a separate board.

Adafruit PyPortal Titano

I just purchased an Adafruit PyPortal Titano, Product ID: 4444, to test out the software and see about allowing the software to be used on different sized screens. The Titano, has a 480×320 screen verses 320×240 of the PyPortal, Product ID: 4116.

The PyPortal Titano that I received had CircuitPython 5 installed, so the first order of business was to install CircuitPython 8. I started by going to the PyPortal CircuitPython Guide on Learn.Adafruit.

  1. Download the latest version of CircuitPython for the PyPortal Titano board by going to https://circuitpython.org/board/pyportal_titano/
  2. Download the UF2 file for CircuitPython 8.0.5
  3. Double click the reset button on the back of the Titano board and make certain the RGB LED turns green. If is is not green, try again.
  4. Copy the file to the PORTALBOOT drive that shows on your PC
    NOTE: Do not be concerned that the preinstalled demo no longer works. The library files are different for different versions.
  5. Download the CircuitPython 8 library files from https://circuitpython.org/libraries
    NOTE: This step is optional as the required libraries are in the GitHub project files
  6. Go to GitHub and download the project files from https://github.com/richteel/PyPortal_Events
  7. Delete the files on the PyPortal Titano
  8. Unzip the files and copy the files in the PyPortal folder to the PyPortal Titano
  9. The PyPortal Titano will restart and the images will change between “Connecting to the Internet” and “Failed to Connect”. The images will not take up the full screen due to the difference in resolution. (Until the code is modified.) The reason it is not connecting is we need add files to an SD Card and put that into the PyPortal Titano.
  10. Copy the files in the SD_Card folder, from GitHub, and paste them into the root of a micro SD Card.
  11. While the SD Card is still in you PC, double click on the index.html file to open the configuration utility.
  12. You may choose to load the config.json file on the card or start creating a new file from scratch by adding new events.
  13. Once you are satisfied with the events, click on the “Secrets” tab and enter your Wi-Fi settings, Timezone, and Adafruit IO Account information.
  14. Once done, click the “Save JSON File” button and save it to the SD Card as config.json.
  15. Remove the card from the PC and insert it into the PyPortal Titano.
  16. Click the reset button on the back of the PyPortal Titano.
  17. If everything was done correctly, you can anticipate that the events will be displayed on the screen
PyPortal Event Countdown running on the PyPortal Titano
The application is in the upper left corner of the screen with space to the right and bottom.

You may notice from the image of the PyPortal Titano screen, the temperature is not displayed as the PyPortal Titano does not have the ADT7410 Temperature Sensor.

The next step will be to see how to detect the screen size or make it a setting in the config.json file.

By richteel

Software and hardware developer who likes learning new things with a passion of sharing knowledge with others.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: