3 Commits

Author SHA1 Message Date
gballan 52530ab2ff [Issue #12] - Adding config options for configuring the pins used for SDA/SCL for the display
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful
2026-09-09 14:15:35 -04:00
gballan 8b4167f7cc Fixing small typo in README
ci/woodpecker/push/woodpecker Pipeline was successful
2026-09-08 21:44:58 -04:00
gballan d1a017a068 [Issue #8] - Adding xargs command to install all dependencies in requirements.txt
ci/woodpecker/push/woodpecker Pipeline was successful
2026-09-08 21:42:59 -04:00
3 changed files with 10 additions and 5 deletions
+5 -4
View File
@@ -10,7 +10,7 @@ A [MicroPython](https://micropython.org/) app to display local time on an SSD130
The following hardware is what I used for a deployment: The following hardware is what I used for a deployment:
* Raspberry Pi Pico 2 W: https://www.amazon.com/dp/B0DRJXPPWL * Raspberry Pi Pico 2 W: https://www.amazon.com/dp/B0DRJXPPWL
* The **W** is VERY important, as without networking it can't reach Home Assistant! * The **W** is VERY important, as without networking it can't reach NTP servers!
* Also a Raspberry Pi Pico W *should* work too, but I haven't tested it yet * Also a Raspberry Pi Pico W *should* work too, but I haven't tested it yet
* Elegoo SSD1306 LCD: https://www.amazon.com/dp/B0FSRQG23K * Elegoo SSD1306 LCD: https://www.amazon.com/dp/B0FSRQG23K
@@ -44,11 +44,12 @@ These are not necessary to run the app, but can be useful for testing and/or fla
1. This has been tested with MicroPython 1.29, but other versions should work. 1. This has been tested with MicroPython 1.29, but other versions should work.
4. Clone this git repository: `git clone https://git.metaunix.net/BitGoblin/pico-time`. 4. Clone this git repository: `git clone https://git.metaunix.net/BitGoblin/pico-time`.
5. `cd` into the repo: `cd pico-time`. 5. `cd` into the repo: `cd pico-time`.
6. Copy `config.example.py` to `config.py` and edit the settings to match your environment. 6. Install Python dependencies via mpremote: `xargs mpremote mip install < requirements.txt`.
7. Copy the Python code over to the Pico: 7. Copy `config.example.py` to `config.py` and edit the settings to match your environment.
8. Copy the Python code over to the Pico:
1. `mpremote cp main.py :main.py` 1. `mpremote cp main.py :main.py`
2. `mpremote cp config.py :config.py` 2. `mpremote cp config.py :config.py`
8. Reset the Pico: `mpremote reset` 9. Reset the Pico: `mpremote reset`
If it worked you should see the display show a message about connecting to WiFi, then syncing time and finally displaying the local time. If it failed, you can monitor the app via `mpremote repl` or using an IDE like [Thonny](https://thonny.org/). If it worked you should see the display show a message about connecting to WiFi, then syncing time and finally displaying the local time. If it failed, you can monitor the app via `mpremote repl` or using an IDE like [Thonny](https://thonny.org/).
+4
View File
@@ -2,6 +2,10 @@
WIFI_SSID = "YourSSID" # Set this to your Wi-Fi network name WIFI_SSID = "YourSSID" # Set this to your Wi-Fi network name
WIFI_PASSWORD = "YourPassword" # Set this to your Wi-Fi network password WIFI_PASSWORD = "YourPassword" # Set this to your Wi-Fi network password
# Display Settings
DISPLAY_SDA_PIN = 4 # Default SDA pin is GP4
DISPLAY_SCL_PIN = 5 # Default SCL pin is GP5
# Time settings # Time settings
USE_24_HOUR = False # Set this to True for 24-hour time (no AM/PM) USE_24_HOUR = False # Set this to True for 24-hour time (no AM/PM)
UTC_OFFSET = -5 # Set this to your desired NTP server UTC_OFFSET = -5 # Set this to your desired NTP server
+1 -1
View File
@@ -15,7 +15,7 @@ except ImportError:
time.sleep(2) time.sleep(2)
# --- Hardware Setup --- # --- Hardware Setup ---
i2c = I2C(0, sda=Pin(16), scl=Pin(17), freq=400000) i2c = I2C(0, sda=Pin(Config.DISPLAY_SDA_PIN), scl=Pin(Config.DISPLAY_SCL_PIN), freq=400000)
oled = ssd1306.SSD1306_I2C(128, 64, i2c) oled = ssd1306.SSD1306_I2C(128, 64, i2c)