Raspberry PI Pico (W)
NeoPixel / OLED clock with NTP
This page describes building and programming NeoPixel / OLED clock driven by NTP based on:
- Raspberry PI Pico W
- SSD1306 128x64 OLED display
- 24x RGB LED NeoPixel circle Ø65, WS2812B
- 24x RGB LED NeoPixel circle Ø85, WS2812B
- Optional microSD slot for storing WiFi config
Programming
I use Visual Studio Code for developing my Raspberry PI Pico projects. Setting up this powerful developing environment is described in this article But I using much simpler method on Windows: this complete package. It contains RP2040 Toolchain pro Windows - Pico-SDK, VSCode a CMake.
Installation directory structure
I have installed SDK in C:\PicoSDK
. But workspaces I have in D:\Home\Development\Personal\PICO
.
If you encountered any problems with build, maybe you'l need manually enter some system variables:
Compiling C sources
Running CMake scripts
Debugging
For debugging Raspberry PI Pico is needed another Raspberry PI Pico :-). It's explained in this article.
Note that NeoPixels may not works in debugger due to timing issues.
Hardware
- For SSD1306 OLED display I use
GP6
as SDA andGP7
as SCL. It's second I2C channel. - NeoPixels uses
GP14
andGP15
. -
I'm not sure but SPI0 is probably used with CYW43439 wireless chip. So MicroSD card uses SPI1:
- MISO =
GP8
. - MOSI =
GP11
- SCK =
GP10
- CS (Chip Select) =
GP9
- MISO =
- There is switch to enable DST. One side is connected to GND via 10k pull-down resistor and
GP12
, other side is connected to 3.3V.
- Green LEDs are quarters of hour.
- Blue LEDs displays minutes. Because we have 60 mins per hour and only 24 LED's, smooth intensity transition is used for non-five minutes.
- Red LEDs displays hours. When we have more than 30th minute, next is lights on so all 24 ones is used.
- Both circles don't have LED0 aligned due to mounting holes shift. There is constant
STRIP65_SHIFT
that corrects it. - OLED displays both UTC and local time - CE(S)T in my case. You have to modify
displayTime
function to change it.
WiFi configuration
There are two possible ways for WiFi configuration:
- In file
CMakeLists.txt
is WiFi configuration. So its necessary to change it and rebuild project. SD card is not needed in this case. You can comment out functionreadWiFiConfig
. - Use microSD card and store file
wifi.txt
with SSID (case sensitive!) at first line and password at second (followed by new line). Then you may use mypicow_ntp_client_background.uf2
Download
GitHub .
If you use miroSD card for WiFi config, simply use
picow_ntp_client_background.uf2
.