Customizing

Simple Stuff

At the top of each version of the code there is a section with some user changeable settings. It looks like this:

Download: file
#--| USER CONFIG |--------------------------
STATION_ID = "9447130"   # tide location, find yours here: https://tidesandcurrents.noaa.gov/
HI_COLOR   = 0x00FF00    # high tide times color
LO_COLOR   = 0x11FFFF    # low tide times color
DATE_COLOR = 0xFFFFFF    # date and time color
#-------------------------------------------

The most important is the station ID, which sets the location. But there are a few others as well. You can change the color used for the text labels, for example.

Not So Simple Stuff

Most of the graphics used for the tides display were created ahead of time and saved as a BMP image file. These were then simply set to be the background image for the PyPortal and the tide information was added on top of that.

What if you want to change the background image for the tides time display? Or you don't like the blue tinted graph and want to change that? To do so, you will need the source files used for generating the BMP images. These are provided below in SVG format. You can use something like Inkscape to edit these and output new BMP files.

12 Hour Time Format

Not a fan of the 24 hour time format? Wish it could be 12 hour AM/PM instead? The current version of the code does not support this. Only 24 hour time format. This is mainly due to wanting to keep things simple. The times shown are simply what is returned from the NOAA web service, which are strings in a 24 hour time format.

It wouldn't be too difficult to add additional parsing, logic, and math to add this. Most of the work would be in adding some form of AM/PM indication to the display. Doing so would be a fun exercise in learning more about Python and CircuitPython.

This guide was first published on Apr 17, 2019. It was last updated on Apr 17, 2019. This page (Customizing) was last updated on Aug 17, 2019.