Raspberry Pi Pico Clock Shields
This is a collection of very versatile clocks due to its different feature sets and sizes, the RGB capabilities and additional buttons and sensors. Nearly all displays comes with a special LED controller wired over GPIO or other standard serial buses up to the Raspberry Pi Pico. Additional momentary push buttons or joysticks and a small buzzer are wired up over simple GPIO lines. Some shield provide also a simple temperature sensor or Real-Time-Clock, mostly wired over a dedicated I2C bus.
Supported Shields
Hardware
Features and Resources |
Appliance View |
5V/100㎃ 3.3V/150㎃ USB-B CR2032 SET/FUNCTION UP DOWN PIEZO LED 10 1 1 1 1
Design Data |
Positions
Data Sheets
Pinouts
LED Matrix |
A 32-bit deep shift register and a 3-bit wide address decoder are connected via pins 14 to 17 as well as 21, 24 and 29. The shift register is structured as serial-in-parallel-out (SIPO) and accepts the bit information of a single LED row in the matrix. Although only 24 bits per line are connected to an LED, 32 bits must always be shifted for each row. This results in an 8-bit zero padding at the end of each LED line. The 8 available rows are realized by an address decoder. This is designed as a 1-of-8 decoder and serves as a line multiplexer (MUX) in the LED matrix.
SIPO-MUX-GP (General Purpose) over SPI
The multi-functional device
SIPO-MUX-GPIO for row 0 over SIPO-MUX-GP
sipo-mux-gpio@0
Access to the two white signaling LED Sign 0 and Sign 1 (between the three buttons on left side) and the double LED tiles Move On, Mon., Tues., Wed., Thur., Fri., Sat. and Sun. by LED alias or the following GPIO line names:
SIPO-MUX-GPIO for row 1 over SIPO-MUX-GP
sipo-mux-gpio@1
Access to the double LED tile Alarm On by LED alias or the following GPIO line names:
SIPO-MUX-GPIO for row 2 over SIPO-MUX-GP
sipo-mux-gpio@2
Access to the double LED tile CountDown by LED alias or the following GPIO line names:
SIPO-MUX-GPIO for row 3 over SIPO-MUX-GP
sipo-mux-gpio@3
Access to the single LED tiles ℉ and ℃ by LED alias or the following GPIO line names:
SIPO-MUX-GPIO for row 4 over SIPO-MUX-GP
sipo-mux-gpio@4
Access to the single LED tiles ㏂ and ㏘ by LED alias or the following GPIO line names:
SIPO-MUX-GPIO for row 5 over SIPO-MUX-GP
sipo-mux-gpio@5
Access to the double LED tile CountUp by LED alias or the following GPIO line names:
SIPO-MUX-GPIO for row 6 over SIPO-MUX-GP
sipo-mux-gpio@6
Access to the double LED tile Hourly by LED alias or the following GPIO line names:
SIPO-MUX-GPIO for row 7 over SIPO-MUX-GP
sipo-mux-gpio@7
Access to the double LED tile AutoLight by LED alias or the following GPIO line names:
SIPO-MUX-DISPLAY over SIPO-MUX-GP
With an x,y-offset of 2,1 the display provides 7 pixel in height (Y) and 22 pixel in width (X).
Devicetree compatible |
Utilization
This shields can be used with any development board, shield, or snippet that
provides a Devicetree node with the raspberrypi,pico-header-r3
property for the compatibility. In particular, the I2C1 bus on pins 9 to 10 and
some GPIO signals on pins 4 to 5, 14 to 22, 24 and 29 of this edge connector
must be free for communication with the buttons, buzzer, LEDs, RTC and sensors
on the shields. The ADC channel 0 on pin 31 must also be free for communication
with the on-shield LDR (photoresistor). The shields also provide the special
Devicetree labels &rpipico_i2c_rtc
, &clock_rtc
,
&rpipico_pwm_buzzers
and &clock_buzzer
for this
purpose.
Programming
Set -DSHIELD=waveshare_pico_clock_green
and use optional the
USB Console Snippet (usb-console) when you invoke west build
.
For example:
Using west:
west build -b rpi_pico -p -S usb-console --shield "waveshare_pico_clock_green" -d build/waveshare_pico_clock_green-helloshell bridle/samples/helloshell
west flash -r uf2 -d build/waveshare_pico_clock_green-helloshell
Using CMake and ninja:
# Use cmake to configure a Ninja-based buildsystem:
cmake -Bbuild/waveshare_pico_clock_green-helloshell -GNinja -DBOARD=rpi_pico -DSHIELD=""waveshare_pico_clock_green"" bridle/samples/helloshell
# Now run the build tool on the generated build system:
ninja -Cbuild/waveshare_pico_clock_green-helloshell flash
Simple test execution on target
(text in bold is a command input)
uart:~$ hello -h hello - say hello uart:~$ hello Hello from shell. uart:~$ hwinfo devid Length: 8 ID: 0x8c998be1de969148 uart:~$ kernel version Zephyr version 3.7.0 uart:~$ bridle version Bridle version 3.7.0 uart:~$ bridle version long Bridle version 3.7.0.0 uart:~$ bridle info Zephyr: 3.7.0 Bridle: 3.7.0 uart:~$ device list devices: - clock-controller@40008000 (READY) DT node labels: clocks - reset-controller@4000c000 (READY) DT node labels: reset - snippet_cdc_acm_console_uart (READY) DT node labels: snippet_cdc_acm_console_uart - uart@40034000 (READY) DT node labels: uart0 pico_serial rpipico_serial - timer@40054000 (READY) DT node labels: timer - gpio@40014000 (READY) DT node labels: gpio0 rpipico_gpio_keys clock_gpio_keys - adc@4004c000 (READY) DT node labels: adc - flash-controller@18000000 (READY) DT node labels: ssi - i2c@40048000 (READY) DT node labels: i2c1 pico_i2c1 rpipico_i2c1 rpipico_i2c_rtc clock_i2c_rtc - i2c@40044000 (READY) DT node labels: i2c0 pico_i2c pico_i2c0 rpipico_i2c rpipico_i2c0 - pwm@40050000 (READY) DT node labels: pwm rpipico_pwm_buzzers clock_pwm_buzzers - vreg@40064000 (READY) DT node labels: vreg - rtc@4005c000 (READY) DT node labels: rtc - spi@40040000 (READY) DT node labels: spi1 pico_spi1 rpipico_spi1 rpipico_spi_leds clock_spi_leds - spi@4003c000 (READY) DT node labels: spi0 pico_spi pico_spi0 rpipico_spi rpipico_spi0 - ds3231-mfd@68 (READY) DT node labels: ds3231_mfd clock_mfd - ds3231-rtc (READY) DT node labels: ds3231_rtc clock_rtc - sipo-mux-gp@0 (READY) DT node labels: sipo_mux_gp clock_sipo_mux - sipo-mux-gpio@7 (READY) DT node labels: sipo_mux_gpio_7 clock_gpio_7 - sipo-mux-gpio@6 (READY) DT node labels: sipo_mux_gpio_6 clock_gpio_6 - sipo-mux-gpio@5 (READY) DT node labels: sipo_mux_gpio_5 clock_gpio_5 - sipo-mux-gpio@4 (READY) DT node labels: sipo_mux_gpio_4 clock_gpio_4 - sipo-mux-gpio@3 (READY) DT node labels: sipo_mux_gpio_3 clock_gpio_3 - sipo-mux-gpio@2 (READY) DT node labels: sipo_mux_gpio_2 clock_gpio_2 - sipo-mux-gpio@1 (READY) DT node labels: sipo_mux_gpio_1 clock_gpio_1 - sipo-mux-gpio@0 (READY) DT node labels: sipo_mux_gpio_0 clock_gpio_0 - wpcg-gpio-leds (READY) DT node labels: wpcg_gpio_leds - ds3231-dts (READY) DT node labels: ds3231_dts clock_dts uart:~$ history [ 0] history [ 1] device list [ 2] bridle info [ 3] bridle version long [ 4] bridle version [ 5] kernel version [ 6] hwinfo devid [ 7] hello [ 8] hello -h
Operate with the first user LED SIG0 on the left side at SIPOMUX-GPIO0:SIG0:
uart:~$ led on wpcg-gpio-leds 0 wpcg-gpio-leds: turning on LED 0 uart:~$ led set_brightness wpcg-gpio-leds 0 0 wpcg-gpio-leds: setting LED 0 brightness to 0 uart:~$ led set_brightness wpcg-gpio-leds 0 50 wpcg-gpio-leds: setting LED 0 brightness to 50 uart:~$ led off wpcg-gpio-leds 0 wpcg-gpio-leds: turning off LED 0
Operate with the first user LED SIG0 on the left side at SIPOMUX-GPIO0:SIG0:
uart:~$ gpio get sipo-mux-gpio@0 SIG0 0 uart:~$ gpio conf sipo-mux-gpio@0 SIG0 oh0 uart:~$ gpio set sipo-mux-gpio@0 SIG0 1 uart:~$ gpio set sipo-mux-gpio@0 SIG0 0 uart:~$ gpio blink sipo-mux-gpio@0 SIG0 Hit any key to exit
Operate with the user input button SET/FUNCTION at GP2:
uart:~$ gpio get gpio@40014000 SET 0 uart:~$ gpio conf gpio@40014000 SET iul uart:~$ gpio get gpio@40014000 SET 1 uart:~$ gpio get gpio@40014000 SET 0 uart:~$ gpio get gpio@40014000 SET 1
Operate with the on-shield high-resistance LDR Rₗ on ADC_CH0:
uart:~$ adc adc@4004c000 resolution 12 uart:~$ adc adc@4004c000 channel id 0 uart:~$ adc adc@4004c000 read 0 read: 51 uart:~$ adc adc@4004c000 read 0 read: 883 uart:~$ adc adc@4004c000 read 0 read: 3147
The Waveshare Pico Clock Green has the on-shield RTC connected on I2C1.
uart:~$ i2c scan i2c@40048000
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
1 devices found on i2c@40048000
The I2C address 0x68
is a Maxim / Analog Devices DS3231 [19] RTC with
integraterd Temperature Sensor and they current temperature can read
from registers 0x11
(MSB) and 0x12
(LSB). For example, for
26.25℃ the register content must be 0x1a
and 0x40
:
uart:~$ i2c read_byte i2c@40048000 68 11 Output: 0x1a uart:~$ i2c read_byte i2c@40048000 68 12 Output: 0x40
For example, for 25.75℃ the register content must be 0x19
and 0xc0
:
uart:~$ i2c read_byte i2c@40048000 68 11 Output: 0x19 uart:~$ i2c read_byte i2c@40048000 68 12 Output: 0xc0
uart:~$ rtc get ds3231-rtc
2024-09-16T12:37:59.000
uart:~$ sensor get ds3231-dts
channel idx=13 ambient_temp shift=5 num_samples=1 value=6848100000ns (25.749999)
Using west:
west build -b rpi_pico/rp2040/w -p -S usb-console --shield "waveshare_pico_clock_green" -d build/waveshare_pico_clock_green-helloshell bridle/samples/helloshell
west flash -r uf2 -d build/waveshare_pico_clock_green-helloshell
Using CMake and ninja:
# Use cmake to configure a Ninja-based buildsystem:
cmake -Bbuild/waveshare_pico_clock_green-helloshell -GNinja -DBOARD=rpi_pico/rp2040/w -DSHIELD=""waveshare_pico_clock_green"" bridle/samples/helloshell
# Now run the build tool on the generated build system:
ninja -Cbuild/waveshare_pico_clock_green-helloshell flash
Simple test execution on target
(text in bold is a command input)
uart:~$ hello -h hello - say hello uart:~$ hello Hello from shell. uart:~$ hwinfo devid Length: 8 ID: 0x8c998be1de969148 uart:~$ kernel version Zephyr version 3.7.0 uart:~$ bridle version Bridle version 3.7.0 uart:~$ bridle version long Bridle version 3.7.0.0 uart:~$ bridle info Zephyr: 3.7.0 Bridle: 3.7.0 uart:~$ device list devices: - clock-controller@40008000 (READY) DT node labels: clocks - reset-controller@4000c000 (READY) DT node labels: reset - snippet_cdc_acm_console_uart (READY) DT node labels: snippet_cdc_acm_console_uart - uart@40034000 (READY) DT node labels: uart0 pico_serial rpipico_serial - timer@40054000 (READY) DT node labels: timer - gpio@40014000 (READY) DT node labels: gpio0 rpipico_gpio_keys clock_gpio_keys - adc@4004c000 (READY) DT node labels: adc - flash-controller@18000000 (READY) DT node labels: ssi - i2c@40048000 (READY) DT node labels: i2c1 pico_i2c1 rpipico_i2c1 rpipico_i2c_rtc clock_i2c_rtc - i2c@40044000 (READY) DT node labels: i2c0 pico_i2c pico_i2c0 rpipico_i2c rpipico_i2c0 - pwm@40050000 (READY) DT node labels: pwm rpipico_pwm_buzzers clock_pwm_buzzers - vreg@40064000 (READY) DT node labels: vreg - rtc@4005c000 (READY) DT node labels: rtc - spi@40040000 (READY) DT node labels: spi1 pico_spi1 rpipico_spi1 rpipico_spi_leds clock_spi_leds - spi@4003c000 (READY) DT node labels: spi0 pico_spi pico_spi0 rpipico_spi rpipico_spi0 - ds3231-mfd@68 (READY) DT node labels: ds3231_mfd clock_mfd - ds3231-rtc (READY) DT node labels: ds3231_rtc clock_rtc - sipo-mux-gp@0 (READY) DT node labels: sipo_mux_gp clock_sipo_mux - sipo-mux-gpio@7 (READY) DT node labels: sipo_mux_gpio_7 clock_gpio_7 - sipo-mux-gpio@6 (READY) DT node labels: sipo_mux_gpio_6 clock_gpio_6 - sipo-mux-gpio@5 (READY) DT node labels: sipo_mux_gpio_5 clock_gpio_5 - sipo-mux-gpio@4 (READY) DT node labels: sipo_mux_gpio_4 clock_gpio_4 - sipo-mux-gpio@3 (READY) DT node labels: sipo_mux_gpio_3 clock_gpio_3 - sipo-mux-gpio@2 (READY) DT node labels: sipo_mux_gpio_2 clock_gpio_2 - sipo-mux-gpio@1 (READY) DT node labels: sipo_mux_gpio_1 clock_gpio_1 - sipo-mux-gpio@0 (READY) DT node labels: sipo_mux_gpio_0 clock_gpio_0 - wpcg-gpio-leds (READY) DT node labels: wpcg_gpio_leds - ds3231-dts (READY) DT node labels: ds3231_dts clock_dts uart:~$ history [ 0] history [ 1] device list [ 2] bridle info [ 3] bridle version long [ 4] bridle version [ 5] kernel version [ 6] hwinfo devid [ 7] hello [ 8] hello -h
Operate with the first user LED SIG0 on the left side at SIPOMUX-GPIO0:SIG0:
uart:~$ led on wpcg-gpio-leds 0 wpcg-gpio-leds: turning on LED 0 uart:~$ led set_brightness wpcg-gpio-leds 0 0 wpcg-gpio-leds: setting LED 0 brightness to 0 uart:~$ led set_brightness wpcg-gpio-leds 0 50 wpcg-gpio-leds: setting LED 0 brightness to 50 uart:~$ led off wpcg-gpio-leds 0 wpcg-gpio-leds: turning off LED 0
Operate with the first user LED SIG0 on the left side at SIPOMUX-GPIO0:SIG0:
uart:~$ gpio get sipo-mux-gpio@0 SIG0 0 uart:~$ gpio conf sipo-mux-gpio@0 SIG0 oh0 uart:~$ gpio set sipo-mux-gpio@0 SIG0 1 uart:~$ gpio set sipo-mux-gpio@0 SIG0 0 uart:~$ gpio blink sipo-mux-gpio@0 SIG0 Hit any key to exit
Operate with the user input button SET/FUNCTION at GP2:
uart:~$ gpio get gpio@40014000 SET 0 uart:~$ gpio conf gpio@40014000 SET iul uart:~$ gpio get gpio@40014000 SET 1 uart:~$ gpio get gpio@40014000 SET 0 uart:~$ gpio get gpio@40014000 SET 1
Operate with the on-shield high-resistance LDR Rₗ on ADC_CH0:
uart:~$ adc adc@4004c000 resolution 12 uart:~$ adc adc@4004c000 channel id 0 uart:~$ adc adc@4004c000 read 0 read: 51 uart:~$ adc adc@4004c000 read 0 read: 883 uart:~$ adc adc@4004c000 read 0 read: 3147
The Waveshare Pico Clock Green has the on-shield RTC connected on I2C1.
uart:~$ i2c scan i2c@40048000
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
1 devices found on i2c@40048000
The I2C address 0x68
is a Maxim / Analog Devices DS3231 [19] RTC with
integraterd Temperature Sensor and they current temperature can read
from registers 0x11
(MSB) and 0x12
(LSB). For example, for
26.25℃ the register content must be 0x1a
and 0x40
:
uart:~$ i2c read_byte i2c@40048000 68 11 Output: 0x1a uart:~$ i2c read_byte i2c@40048000 68 12 Output: 0x40
For example, for 25.75℃ the register content must be 0x19
and 0xc0
:
uart:~$ i2c read_byte i2c@40048000 68 11 Output: 0x19 uart:~$ i2c read_byte i2c@40048000 68 12 Output: 0xc0
uart:~$ rtc get ds3231-rtc
2024-09-16T12:37:59.000
uart:~$ sensor get ds3231-dts
channel idx=13 ambient_temp shift=5 num_samples=1 value=6848100000ns (25.749999)
on standard 4㎆
revision
Using west:
west build -b waveshare_rp2040_plus -p -S usb-console --shield "waveshare_pico_clock_green" -d build/waveshare_pico_clock_green-helloshell bridle/samples/helloshell
west flash -r uf2 -d build/waveshare_pico_clock_green-helloshell
Using CMake and ninja:
# Use cmake to configure a Ninja-based buildsystem:
cmake -Bbuild/waveshare_pico_clock_green-helloshell -GNinja -DBOARD=waveshare_rp2040_plus -DSHIELD=""waveshare_pico_clock_green"" bridle/samples/helloshell
# Now run the build tool on the generated build system:
ninja -Cbuild/waveshare_pico_clock_green-helloshell flash
on extended 16㎆
revision
Using west:
west build -b waveshare_rp2040_plus@16mb -p -S usb-console --shield "waveshare_pico_clock_green" -d build/waveshare_pico_clock_green-helloshell bridle/samples/helloshell
west flash -r uf2 -d build/waveshare_pico_clock_green-helloshell
Using CMake and ninja:
# Use cmake to configure a Ninja-based buildsystem:
cmake -Bbuild/waveshare_pico_clock_green-helloshell -GNinja -DBOARD=waveshare_rp2040_plus@16mb -DSHIELD=""waveshare_pico_clock_green"" bridle/samples/helloshell
# Now run the build tool on the generated build system:
ninja -Cbuild/waveshare_pico_clock_green-helloshell flash
Simple test execution on target
(text in bold is a command input)
uart:~$ hello -h hello - say hello uart:~$ hello Hello from shell. uart:~$ hwinfo devid Length: 8 ID: 0x8c998be1de969148 uart:~$ kernel version Zephyr version 3.7.0 uart:~$ bridle version Bridle version 3.7.0 uart:~$ bridle version long Bridle version 3.7.0.0 uart:~$ bridle info Zephyr: 3.7.0 Bridle: 3.7.0 uart:~$ device list devices: - clock-controller@40008000 (READY) DT node labels: clocks - reset-controller@4000c000 (READY) DT node labels: reset - snippet_cdc_acm_console_uart (READY) DT node labels: snippet_cdc_acm_console_uart - uart@40034000 (READY) DT node labels: uart0 pico_serial rpipico_serial - timer@40054000 (READY) DT node labels: timer - gpio@40014000 (READY) DT node labels: gpio0 rpipico_gpio_keys clock_gpio_keys - adc@4004c000 (READY) DT node labels: adc - flash-controller@18000000 (READY) DT node labels: ssi - i2c@40048000 (READY) DT node labels: i2c1 pico_i2c1 rpipico_i2c1 rpipico_i2c_rtc clock_i2c_rtc - i2c@40044000 (READY) DT node labels: i2c0 pico_i2c pico_i2c0 rpipico_i2c rpipico_i2c0 - pwm@40050000 (READY) DT node labels: pwm rpipico_pwm_buzzers clock_pwm_buzzers - vreg@40064000 (READY) DT node labels: vreg - rtc@4005c000 (READY) DT node labels: rtc - spi@40040000 (READY) DT node labels: spi1 pico_spi1 rpipico_spi1 rpipico_spi_leds clock_spi_leds - spi@4003c000 (READY) DT node labels: spi0 pico_spi pico_spi0 rpipico_spi rpipico_spi0 - ds3231-mfd@68 (READY) DT node labels: ds3231_mfd clock_mfd - ds3231-rtc (READY) DT node labels: ds3231_rtc clock_rtc - sipo-mux-gp@0 (READY) DT node labels: sipo_mux_gp clock_sipo_mux - sipo-mux-gpio@7 (READY) DT node labels: sipo_mux_gpio_7 clock_gpio_7 - sipo-mux-gpio@6 (READY) DT node labels: sipo_mux_gpio_6 clock_gpio_6 - sipo-mux-gpio@5 (READY) DT node labels: sipo_mux_gpio_5 clock_gpio_5 - sipo-mux-gpio@4 (READY) DT node labels: sipo_mux_gpio_4 clock_gpio_4 - sipo-mux-gpio@3 (READY) DT node labels: sipo_mux_gpio_3 clock_gpio_3 - sipo-mux-gpio@2 (READY) DT node labels: sipo_mux_gpio_2 clock_gpio_2 - sipo-mux-gpio@1 (READY) DT node labels: sipo_mux_gpio_1 clock_gpio_1 - sipo-mux-gpio@0 (READY) DT node labels: sipo_mux_gpio_0 clock_gpio_0 - wpcg-gpio-leds (READY) DT node labels: wpcg_gpio_leds - ds3231-dts (READY) DT node labels: ds3231_dts clock_dts uart:~$ history [ 0] history [ 1] device list [ 2] bridle info [ 3] bridle version long [ 4] bridle version [ 5] kernel version [ 6] hwinfo devid [ 7] hello [ 8] hello -h
Operate with the first user LED SIG0 on the left side at SIPOMUX-GPIO0:SIG0:
uart:~$ led on wpcg-gpio-leds 0 wpcg-gpio-leds: turning on LED 0 uart:~$ led set_brightness wpcg-gpio-leds 0 0 wpcg-gpio-leds: setting LED 0 brightness to 0 uart:~$ led set_brightness wpcg-gpio-leds 0 50 wpcg-gpio-leds: setting LED 0 brightness to 50 uart:~$ led off wpcg-gpio-leds 0 wpcg-gpio-leds: turning off LED 0
Operate with the first user LED SIG0 on the left side at SIPOMUX-GPIO0:SIG0:
uart:~$ gpio get sipo-mux-gpio@0 SIG0 0 uart:~$ gpio conf sipo-mux-gpio@0 SIG0 oh0 uart:~$ gpio set sipo-mux-gpio@0 SIG0 1 uart:~$ gpio set sipo-mux-gpio@0 SIG0 0 uart:~$ gpio blink sipo-mux-gpio@0 SIG0 Hit any key to exit
Operate with the user input button SET/FUNCTION at GP2:
uart:~$ gpio get gpio@40014000 SET 0 uart:~$ gpio conf gpio@40014000 SET iul uart:~$ gpio get gpio@40014000 SET 1 uart:~$ gpio get gpio@40014000 SET 0 uart:~$ gpio get gpio@40014000 SET 1
Operate with the on-shield high-resistance LDR Rₗ on ADC_CH0:
uart:~$ adc adc@4004c000 resolution 12 uart:~$ adc adc@4004c000 channel id 0 uart:~$ adc adc@4004c000 read 0 read: 51 uart:~$ adc adc@4004c000 read 0 read: 883 uart:~$ adc adc@4004c000 read 0 read: 3147
The Waveshare Pico Clock Green has the on-shield RTC connected on I2C1.
uart:~$ i2c scan i2c@40048000
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
1 devices found on i2c@40048000
The I2C address 0x68
is a Maxim / Analog Devices DS3231 [19] RTC with
integraterd Temperature Sensor and they current temperature can read
from registers 0x11
(MSB) and 0x12
(LSB). For example, for
26.25℃ the register content must be 0x1a
and 0x40
:
uart:~$ i2c read_byte i2c@40048000 68 11 Output: 0x1a uart:~$ i2c read_byte i2c@40048000 68 12 Output: 0x40
For example, for 25.75℃ the register content must be 0x19
and 0xc0
:
uart:~$ i2c read_byte i2c@40048000 68 11 Output: 0x19 uart:~$ i2c read_byte i2c@40048000 68 12 Output: 0xc0
uart:~$ rtc get ds3231-rtc
2024-09-16T12:37:59.000
uart:~$ sensor get ds3231-dts
channel idx=13 ambient_temp shift=5 num_samples=1 value=6848100000ns (25.749999)
More Samples
Input dump
Prints all input events as defined by the shields Devicetree. See also Zephyr sample: Input dump.
Print the input events related to the five on-shield user input keys and two user keys using the Input subsystem API. That are:
zephyr,code = <INPUT_KEY_ENTER>;
zephyr,code = <INPUT_KEY_UP>;
zephyr,code = <INPUT_KEY_DOWN>;
west build -b rpi_pico -p -S usb-console --shield "waveshare_pico_clock_green" -d build/waveshare_pico_clock_green-input_dump zephyr/samples/subsys/input/input_dump
west flash -r uf2 -d build/waveshare_pico_clock_green-input_dump
west build -b rpi_pico/rp2040/w -p -S usb-console --shield "waveshare_pico_clock_green" -d build/waveshare_pico_clock_green-input_dump zephyr/samples/subsys/input/input_dump
west flash -r uf2 -d build/waveshare_pico_clock_green-input_dump
on standard 4㎆
revision
west build -b waveshare_rp2040_plus -p -S usb-console --shield "waveshare_pico_clock_green" -d build/waveshare_pico_clock_green-input_dump zephyr/samples/subsys/input/input_dump
west flash -r uf2 -d build/waveshare_pico_clock_green-input_dump
on extended 16㎆
revision
west build -b waveshare_rp2040_plus@16mb -p -S usb-console --shield "waveshare_pico_clock_green" -d build/waveshare_pico_clock_green-input_dump zephyr/samples/subsys/input/input_dump
west flash -r uf2 -d build/waveshare_pico_clock_green-input_dump
Simple logging output on target
***** delaying boot 4000ms (per build configuration) ***** W: BUS RESET W: BUS RESET *** Booting Zephyr OS build v3.7.0… (delayed boot 4000ms) *** Input sample started I: input event: dev=wpcg-gpio-keys SYN type= 1 code= 28 value=1 I: input event: dev=wpcg-gpio-keys SYN type= 1 code= 28 value=0 I: input event: dev=wpcg-gpio-keys SYN type= 1 code=103 value=1 I: input event: dev=wpcg-gpio-keys SYN type= 1 code=103 value=0 I: input event: dev=wpcg-gpio-keys SYN type= 1 code=108 value=1 I: input event: dev=wpcg-gpio-keys SYN type= 1 code=108 value=0
Analog-to-Digital Converter (ADC)
Read analog inputs from ADC channels as defined by the shield’s Devicetree. See also Zephyr sample: Analog-to-Digital Converter (ADC) with devicetree.
Read and print the analog input value from the one on-shield high-resistance LDR using the ADC driver API. That are:
zephyr,user { io-channels = <&adc 0>; };
west build -b rpi_pico -p -S usb-console --shield "waveshare_pico_clock_green" -d build/waveshare_pico_clock_green-drivers_adc zephyr/samples/drivers/adc/adc_dt
west flash -r uf2 -d build/waveshare_pico_clock_green-drivers_adc
west build -b rpi_pico/rp2040/w -p -S usb-console --shield "waveshare_pico_clock_green" -d build/waveshare_pico_clock_green-drivers_adc zephyr/samples/drivers/adc/adc_dt
west flash -r uf2 -d build/waveshare_pico_clock_green-drivers_adc
on standard 4㎆
revision
west build -b waveshare_rp2040_plus -p -S usb-console --shield "waveshare_pico_clock_green" -d build/waveshare_pico_clock_green-drivers_adc zephyr/samples/drivers/adc/adc_dt
west flash -r uf2 -d build/waveshare_pico_clock_green-drivers_adc
on extended 16㎆
revision
west build -b waveshare_rp2040_plus@16mb -p -S usb-console --shield "waveshare_pico_clock_green" -d build/waveshare_pico_clock_green-drivers_adc zephyr/samples/drivers/adc/adc_dt
west flash -r uf2 -d build/waveshare_pico_clock_green-drivers_adc
Simple test execution on target
***** delaying boot 4000ms (per build configuration) ***** W: BUS RESET W: BUS RESET *** Booting Zephyr OS build v3.7.0… (delayed boot 4000ms) *** ADC reading[0]: - adc@4004c000, channel 0: 907 = 730 mV ADC reading[1]: - adc@4004c000, channel 0: 910 = 733 mV ADC reading[2]: - adc@4004c000, channel 0: 1233 = 993 mV ADC reading[3]: - adc@4004c000, channel 0: 1196 = 963 mV ADC reading[4]: - adc@4004c000, channel 0: 569 = 458 mV ADC reading[5]: - adc@4004c000, channel 0: 336 = 270 mV ADC reading[6]: - adc@4004c000, channel 0: 285 = 229 mV ADC reading[7]: - adc@4004c000, channel 0: 181 = 145 mV ADC reading[8]: - adc@4004c000, channel 0: 56 = 45 mV ADC reading[9]: - adc@4004c000, channel 0: 59 = 47 mV ADC reading[10]: - adc@4004c000, channel 0: 56 = 45 mV ADC reading[11]: - adc@4004c000, channel 0: 480 = 386 mV ADC reading[12]: - adc@4004c000, channel 0: 868 = 699 mV ADC reading[13]: - adc@4004c000, channel 0: 1878 = 1513 mV ADC reading[14]: - adc@4004c000, channel 0: 3256 = 2623 mV ADC reading[15]: - adc@4004c000, channel 0: 3413 = 2749 mV ADC reading[16]: - adc@4004c000, channel 0: 3446 = 2776 mV ADC reading[17]: - adc@4004c000, channel 0: 3470 = 2795 mV ADC reading[18]: - adc@4004c000, channel 0: 3451 = 2780 mV ADC reading[19]: - adc@4004c000, channel 0: 1029 = 829 mV ADC reading[20]: - adc@4004c000, channel 0: 1004 = 808 mV ADC reading[21]: - adc@4004c000, channel 0: 1005 = 809 mV ADC reading[22]: - adc@4004c000, channel 0: 1000 = 805 mV … … …
Sounds from the speaker
The sample is prepared for the on-board PIEZO connected to the PWM channel at GP14 / PWM14 (PWM7CHA).
The PWM period is 880 ㎐, twice the concert pitch frequency of 440 ㎐.
west build -b rpi_pico -p -S usb-console --shield "waveshare_pico_clock_green" -d build/waveshare_pico_clock_green-buzzer bridle/samples/buzzer
west flash -r uf2 -d build/waveshare_pico_clock_green-buzzer
west build -b rpi_pico/rp2040/w -p -S usb-console --shield "waveshare_pico_clock_green" -d build/waveshare_pico_clock_green-buzzer bridle/samples/buzzer
west flash -r uf2 -d build/waveshare_pico_clock_green-buzzer
on standard 4㎆
revision
west build -b waveshare_rp2040_plus -p -S usb-console --shield "waveshare_pico_clock_green" -d build/waveshare_pico_clock_green-buzzer bridle/samples/buzzer
west flash -r uf2 -d build/waveshare_pico_clock_green-buzzer
on extended 16㎆
revision
west build -b waveshare_rp2040_plus@16mb -p -S usb-console --shield "waveshare_pico_clock_green" -d build/waveshare_pico_clock_green-buzzer bridle/samples/buzzer
west flash -r uf2 -d build/waveshare_pico_clock_green-buzzer
Simple test execution on target
play a beep
play a folk song
play a chrismas song
uart:~$ buzzer beep uart:~$ buzzer play folksong uart:~$ buzzer play xmastime
LED Panel Orientation and Bit Order Test
Draw some basic rectangles onto the LED panel. The rectangle positions are chosen so that you can check the orientation of the LED panel and correct bit order. See also Zephyr sample: Display.
The following samples work with the chosen display. That is:
chosen { zephyr,display = &clock_display; };
clock_display: &sipo_mux_display_8 {};
west build -b rpi_pico -p -S usb-console --shield "waveshare_pico_clock_green" -d build/waveshare_pico_clock_green-display_test zephyr/samples/drivers/display
west flash -r uf2 -d build/waveshare_pico_clock_green-display_test
west build -b rpi_pico/rp2040/w -p -S usb-console --shield "waveshare_pico_clock_green" -d build/waveshare_pico_clock_green-display_test zephyr/samples/drivers/display
west flash -r uf2 -d build/waveshare_pico_clock_green-display_test
on standard 4㎆
revision
west build -b waveshare_rp2040_plus -p -S usb-console --shield "waveshare_pico_clock_green" -d build/waveshare_pico_clock_green-display_test zephyr/samples/drivers/display
west flash -r uf2 -d build/waveshare_pico_clock_green-display_test
on extended 16㎆
revision
west build -b waveshare_rp2040_plus@16mb -p -S usb-console --shield "waveshare_pico_clock_green" -d build/waveshare_pico_clock_green-display_test zephyr/samples/drivers/display
west flash -r uf2 -d build/waveshare_pico_clock_green-display_test