From 20331b81bc34f9a29a4d5c3199661a8a0297c1b3 Mon Sep 17 00:00:00 2001 From: BlueFox Date: Fri, 15 Nov 2024 15:57:07 +0100 Subject: [PATCH] Added a configuration list to README.md --- README.md | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index be31a48..695f769 100644 --- a/README.md +++ b/README.md @@ -30,15 +30,40 @@ To install this, use [Thonny](https://thonny.org/), open all the files present i ## Configuration -All the configuration can be done in the [config.py](config.py) file, just have a look around there. Some hints for editing this file: +All the configuration can be done in the [config.json](config.json) file in JSON format just have a look around there. Some hints for editing this file: -- When editing the startup section strings, make sure the "STARTUP_PROJECT_NAME" and the "STARTUP_MESSAGE_FINISHED" values have the same length as your display can show (likely 16 characters). Otherwise it could be that some things won't be displayed correctly. +- For a description of all of the attributes, see below + +- When editing the startup section strings, make sure the "STARTUP\_PROJECT\_NAME" and the "STARTUP\_MESSAGE\_FINISHED" values have the same length as your display can show (likely 16 characters). Otherwise it could be that some things won't be displayed correctly. - When changing Pins in the Pinout section, make sure to follow the pinout assignment of your Pi Pico board (e.g. the i2c sda and scl pins) - If your display doesn't work properly - the first issue might be a wrong i2c address. To find the address of your display, just follow some of the tutorials on the internet on scanning for i2c devices (e.g. [here](https://randomnerdtutorials.com/raspberry-pi-pico-i2c-scanner-micropython/)). +### Attribute table + +| Attribute name (on top level in config.json) | Type | Description | Default | +| -------------------------------------------- | ---- | ----------- | ------- | +| "LOG\_LEVEL" | int | defines up to which log level to show log messages in the serial console: warn (0), info (1), debug (2) | 2 | +| "STARTUP\_WELCOME\_SHOW" | bool | show the startup screen? | true | +| "STARTUP\_PROJECT\_NAME" | str | the name shown at the welcome/startup screen | " UV-Belichter " | +| "STARTUP\_MESSAGE\_STARTING | str | the message shown at startup when starting | "Starting..." | +| "STARTUP\_PROJECT\_FINISHED" | str | the message shown at startup when finished | " Started! " | +| "STARTUP\_WELCOME\_CYCLES" | int | how often the starting string shall go over the welcome screen | 1 | +| "PIN\_IN\_BTN\_1" | dict | the dict must contain the "pin" and "pull" keys with respective values | {"pin": 15, "pull": "down"} | +| "PIN\_IN\_BTN\_2" | dict | as above | {"pin": 14, "pull": "down"} | +| "PIN\_IN\_SWITCH" | dict | as above | {"pin": 13, "pull": "down"} | +| "PIN\_OUT\_RELAIS" | int | pin number where the relais is connected | 21 | +| "PIN\_SDA" | int | the pin number of the sda wire connected to the lcd | 8 | +| "PIN\_SCL" | int | the pin number of the scl wire connected to the lcd | 9 | +| "LCD\_I2C\_CH" | int | the channel of the i2c bus used | 0 | +| "LCD\_I2C\_ADDR" | int | the i2c address of the lcd; make sure to convert hexadecimal to decimal numbers | 38 | +| "LCD\_I2C\_NUM\_ROWS" | int | how many rows for character display has the display? | 2 | +| "LCD\_I2C\_NUM\_COLS" | int | and how many characters can it display per row? | 16 | + +Note that this software has it's own small wrapper for the config file, e.g. to have instant access to an LCD object generated on the fly. These are all documented in the [utils.py](utils.py) file! + ## Used libraries - PCF8574T - a driver for the i2c multiplexer used to address the 2x16 lcd display