NTP Clock

This guide will show you how to connect to the internet and get internet time using Raspberry Pi Pico W with your Robo Pico.

Note: This IoT related project is only applicable if you are using Raspberry Pi Pico W but NOT Raspberry Pi Pico.

 

1. While your Robo Pico is connected to your computer, open your editor software (for example Thonny). Select the code.py file in your drive.

 

2. Copy and paste the following code to your editor.


3. Flash the codes to your Raspberry Pi Pico / Pico W. And your CIRCUITPY drive should look like this:

Library file(s) required:
    adafruit_ntp.mpy

File(s) required:
   settings.toml

 

If you don't have this file in your computer, download the lib bundle here and search for this file inside the "lib" folder.

 

In the 'setting.toml' file, you will see lines like these:

CIRCUITPY_WIFI_SSID = "your-ssid-here"
CIRCUITPY_WIFI_PASSWORD = "your-ssid-password-here"

 

Simply replace 'your-ssid-here' with the name of your WiFi network, and 'your-ssid-password-here' with your WiFi password.

 

Advanced Code: NTP Alarm Clock 

You can make your Robo Pico into your alarm clock and display your current clock on the OLED Display.

1. Make sure to copy this code including the file inside 'ntp-clock-alarm' into your CIRCUITPY drive.  

 

2. Flash the codes to your Raspberry Pi Pico / Pico W. And your CIRCUITPY drive should look like this:

Library file(s) required:
    adafruit_ntp.mpy, adafruit_framebuf.mpy, adafruit_ssd1306.mpy, neopixel.mpy, simpleio.mpy

File(s) required:
    font5x8.bin, settings.toml

อุปกรณ์ฮาร์ดแวร์