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

The Waveshare Pico Clock Green [1] is a special sized LED-digit electronic clock designed for Raspberry Pi Pico, a RP2040 based development board. It contains a high-precision RTC chip DS3231 [19] with an on-chip temperature sensor for ambient, auto-brightness adjustment by an photoresistor (LDR), alarm signaling by a simple buzzer. a LED matrix with 8 × 1-bit × 24 pixel for special signing lights and data display and buttons for navigation and configuration.

Features and Resources

Appliance View

5V/100㎃ 3.3V/150㎃

USB-B CR2032

SET/FUNCTION UP DOWN LED

9 1 1 1

  • On-board USB-C connector

  • On-board 3.3V LDO voltage regulator with 800~1000㎃

  • On-board CR2032 coin battery holder for RTC backup

  • 1 serial 8×24 LED matrix (monochrome)

  • 1 RTC with temperature sensor

  • 1 LDR light sensor

  • 3 User keys

  • 3 ADDR signals to LED matrix controller

  • 1 LE signal to LED matrix controller

  • 1 OE signal to LED matrix controller

  • 1 IRQ signal from RTC

  • 1 I2C controller for RTC

  • 1 SPI controller for LED matrix controller`

  • 1 ADC analog input for LDR light sensor

Design Data

Waveshare Pico Clock Green

Positions

Waveshare Pico Clock Green details
  1. User buttons
    momentary push buttons
    SET/FUNCTION (ENTER), UP, DOWN
  2. LED matrix
    8×24 1-bit monochrome pixel driven by discrete logic with:
    2×16-bit serial-in-parallel-out (SIPO) shift register
    1×3-to-8 address decoder (MUX)
  3. LDR (CdS)
    Cadmium Sulfide (CdS) photoresistor (LDR) with:
    about 2~20㏀ on light and ≫1㏁ on darkness
  4. USB Type-B connector
    Supports USB1.1 hosts and slave devices
  5. XC6206P332MR
    200㎃ low dropout, low quiescent current
    3.3V power supply for RTC
  6. AMS1117-3.3
    1A low dropout, high efficiency linear regulators LDO
    3.3V power supply for LED matrix
  1. Piezo Buzzer
    5.0Vo-p (3.0~8.0V) @ 2.400㎑±300㎐ with ≥85㏈
  2. SM16106SC/SM5166P
    SIPO-MUX-GP (General Purpose) matrix controller (discrete logic)
    2×16-bit SIPO 16-channel LED constant current driver
    1×3-to-8 MUX 8-channel LED output current drive
  3. CR2032
    3.0V @ 235㎃h coin battery holder, backup power supply for RTC
  4. DS3231
    Real-Time-Clock (RTC), extremely high accuracy, with:
    temperature-compensated crystal oscillator (TCXO) and crystal,
    battery input for backup on power lost, accurate timekeeping,
    ±3.5㏙ accuracy from -40℃ to +85℃, ±2㏙ from 0℃ to +40℃
    2× time-of-day alarms, valid up to 2100, square-wave output,
    1× digital temp. sensor with ¼℃ resolution and ±3℃ accuracy

Data Sheets

Pinouts

Pin Mapping

Pinout

on-shield:

9 1 1 1

3 BUTTON 32 SIGNALS 1 LED MATRIX 1 PIEZO

Default Zephyr Peripheral Mapping

 

  • 1 PIO/PWM : GP0 (PWM0)
  • 2 PIO/PWM : GP1 (PWM1)
  • 3 GND
  • 4 K2 : GP2 (PWM2)
  • 5 RTC : GP3 (PWM3)
    nc on-shield RTC i/f output ISW
  • 6 PIO/PWM : GP4 (PWM4)
  • 7 PIO/PWM : GP5 (PWM5)
  • 8 GND
  • 9 RTC I2C1_SDA : GP6
  • 10 RTC I2C1_SCL : GP7
    nc on-shield RTC i/f I2C SDA/SCL
  • 11 PIO/PWM : GP8 (PWM8)
  • 12 PIO/PWM : GP9 (PWM9)
  • 13 GND
  • 14 LED SPI1_SCK : GP10
    nc on-shield SIPO i/f clock SIPO_CLK
  • 15 LED SPI1_TX : GP11
    nc on-shield SIPO i/f data SIPO_SDI
  • 16 LED SPI1_CSN : GP12
    nc on-shield SIPO i/f latch SIPO_LE
  • 17 LED : GP13 (PWM13)
    nc on-shield SIPO i/f output SIPO_OE
  • 18 GND
  • 19 PIEZO : GP14 PWM14
  • 20 K0 : GP15 (PWM15)
  • 21 LED : GP16 (PWM0)
    nc on-shield MUX i/f addr MUX_A0
  • 22 K1 : GP17 (PWM1)
  • 23 GND
  • 24 LED : GP18 (PWM2)
    nc on-shield MUX i/f addr MUX_A1
  • 25 PIO/PWM : GP19 (PWM3)
  • 26 PIO/PWM : GP20 (PWM4)
  • 27 PIO/PWM : GP21 (PWM5)
  • 28 GND
  • 29 LED : GP22 (PWM6)
    nc on-shield MUX i/f addr MUX_A2
  • 30 RUN (RESET)
  • nc PIO/PWM : GP23 (PWM7)
  • nc PIO/PWM : GP24 (PWM8)
  • nc PIO/PWM : GP25 (PWM9)
  • 31 Rₗ : ADC_CH0 : GP26 (PWM10)
  • 32 ADC_CH1 : GP27 (PWM11)
  • 33 GND
  • 34 ADC_CH2 : GP28 (PWM12)
  • nc ADC_CH3 : GP29 (PWM13)
  • 35 ADC_VREF
  • 36 3V3(OUT)
  • 37 3V3_EN
  • 38 GND
  • 39 VSYS
  • 40 VBUS

Devicetree compatible

Waveshare Pico Clock Green edge pinout

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.

 

Waveshare Pico Clock Green LED matrix

 

SIPO-MUX-GP (General Purpose) over SPI

 

The multi-functional device sipo-mux-gp with the special backend sipo-mux-gp-spi is used to access individual LEDs or entire groups via different Zephyr APIs. Based on this MFD, each individual LED can be accessed via GPIO pins (sipo-mux-gpio) or via a Zephyr display (sipo-mux-display).

 

sipo_mux_gp: sipo-mux-gp@0 {};

  • compatible = "sipo-mux-gp-spi";

  • data-width = <24>;

  • shift-width = <32>;

  • refresh-time-us = <500>;

  • spi-max-frequency = <DT_FREQ_M(30)>;

SIPO-MUX-GPIO for row 0 over SIPO-MUX-GP

 

sipo_mux_gpio_0: sipo-mux-gpio@0 {};

  • compatible = "sipo-mux-gpio";

  • offset = <0>;

  • ngpios = <24>;

sipo-mux-gpio@0

  • MOV0 : 0 led16

  • MOV1 : 1 led17

  • SIG0 : 2 led0

  • MON0 : 3 led2

  • MON1 : 4 led3

  • SIG1 : 5 led1

  • TUE0 : 6 led4

  • TUE1 : 7 led5

  •  
    gpio-reserved-ranges = <8 1>;
     
  • WED0 : 9 led6

  • WED1 : 10 led7

  •  
    gpio-reserved-ranges = <11 1>;
     
  • THU0 : 12 led8

  • THU1 : 13 led9

  •  
    gpio-reserved-ranges = <14 1>;
     
  • FRI0 : 15 led10

  • FRI1 : 16 led11

  •  
    gpio-reserved-ranges = <17 1>;
     
  • SAT0 : 18 led12

  • SAT1 : 19 led13

  •  
    gpio-reserved-ranges = <20 1>;
     
  • SUN0 : 21 led14

  • SUN1 : 22 led15

  •  
    gpio-reserved-ranges = <23 1>;
     

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:

  • alias led0 is LED Signal 0 with GPIO line name SIG0

  • alias led1 is LED Signal 1 with GPIO line name SIG1

  • alias led2 is LED Monday 0 with GPIO line name MON0

  • alias led3 is LED Monday 1 with GPIO line name MON1

  • alias led4 is LED Tuesday 0 with GPIO line name TUE0

  • alias led5 is LED Tuesday 1 with GPIO line name TUE1

  • alias led6 is LED Wednesday 0 with GPIO line name WED0

  • alias led7 is LED Wednesday 1 with GPIO line name WED1

  • alias led8 is LED Thursday 0 with GPIO line name THU0

  • alias led9 is LED Thursday 1 with GPIO line name THU1

  • alias led10 is LED Friday 0 with GPIO line name FRI0

  • alias led11 is LED Friday 1 with GPIO line name FRI1

  • alias led12 is LED Saturday 0 with GPIO line name SAT0

  • alias led13 is LED Saturday 1 with GPIO line name SAT1

  • alias led14 is LED Sunday 0 with GPIO line name SUN0

  • alias led15 is LED Sunday 1 with GPIO line name SUN1

  • alias led16 is LED Move On 0 with GPIO line name MOV0

  • alias led17 is LED Move On 1 with GPIO line name MOV1

SIPO-MUX-GPIO for row 1 over SIPO-MUX-GP

 

sipo_mux_gpio_1: sipo-mux-gpio@1 {};

  • compatible = "sipo-mux-gpio";

  • offset = <24>;

  • ngpios = <24>;

sipo-mux-gpio@1

  • ALM0 : 0 led18

  • ALM1 : 1 led19

  • L102 : 2 LED : (0,0)

  • L103 : 3 LED : (1,0)

  • L104 : 4 LED : (2,0)

  • L105 : 5 LED : (3,0)

  • L106 : 6 LED : (4,0)

  • L107 : 7 LED : (5,0)

  • L108 : 8 LED : (6,0)

  • L109 : 9 LED : (7,0)

  • L110 : 10 LED : (8,0)

  • L111 : 11 LED : (9,0)

  • L112 : 12 LED : (10,0)

  • L113 : 13 LED : (11,0)

  • L114 : 14 LED : (12,0)

  • L115 : 15 LED : (13,0)

  • L116 : 16 LED : (14,0)

  • L117 : 17 LED : (15,0)

  • L118 : 18 LED : (16,0)

  • L119 : 19 LED : (17,0)

  • L120 : 20 LED : (18,0)

  • L121 : 21 LED : (19,0)

  • L222 : 22 LED : (20,0)

  • L123 : 23 LED : (21,0)

Access to the double LED tile Alarm On by LED alias or the following GPIO line names:

  • alias led18 is LED Alarm On 0 with GPIO line name ALM0

  • alias led19 is LED Alarm On 1 with GPIO line name ALM1

SIPO-MUX-GPIO for row 2 over SIPO-MUX-GP

 

sipo_mux_gpio_2: sipo-mux-gpio@2 {};

  • compatible = "sipo-mux-gpio";

  • offset = <48>;

  • ngpios = <24>;

sipo-mux-gpio@2

  • CDN0 : 0 led20

  • CDN1 : 1 led21

  • L202 : 2 LED : (0,1)

  • L203 : 3 LED : (1,1)

  • L204 : 4 LED : (2,1)

  • L205 : 5 LED : (3,1)

  • L206 : 6 LED : (4,1)

  • L207 : 7 LED : (5,1)

  • L208 : 8 LED : (6,1)

  • L209 : 9 LED : (7,1)

  • L210 : 10 LED : (8,1)

  • L211 : 11 LED : (9,1)

  • L212 : 12 LED : (10,1)

  • L213 : 13 LED : (11,1)

  • L214 : 14 LED : (12,1)

  • L215 : 15 LED : (13,1)

  • L216 : 16 LED : (14,1)

  • L217 : 17 LED : (15,1)

  • L218 : 18 LED : (16,1)

  • L219 : 19 LED : (17,1)

  • L220 : 20 LED : (18,1)

  • L221 : 21 LED : (19,1)

  • L222 : 22 LED : (20,1)

  • L223 : 23 LED : (21,1)

Access to the double LED tile CountDown by LED alias or the following GPIO line names:

  • alias led20 is LED Count Down 0 with GPIO line name CDN0

  • alias led21 is LED Count Down 1 with GPIO line name CDN1

SIPO-MUX-GPIO for row 3 over SIPO-MUX-GP

 

sipo_mux_gpio_3: sipo-mux-gpio@3 {};

  • compatible = "sipo-mux-gpio";

  • offset = <72>;

  • ngpios = <24>;

sipo-mux-gpio@3

  • DEGF : 0 led22

  • DEGC : 1 led23

  • L302 : 2 LED : (0,2)

  • L303 : 3 LED : (1,2)

  • L304 : 4 LED : (2,2)

  • L305 : 5 LED : (3,2)

  • L306 : 6 LED : (4,2)

  • L307 : 7 LED : (5,2)

  • L308 : 8 LED : (6,2)

  • L309 : 9 LED : (7,2)

  • L310 : 10 LED : (8,2)

  • L311 : 11 LED : (9,2)

  • L312 : 12 LED : (10,2)

  • L313 : 13 LED : (11,2)

  • L314 : 14 LED : (12,2)

  • L315 : 15 LED : (13,2)

  • L316 : 16 LED : (14,2)

  • L317 : 17 LED : (15,2)

  • L318 : 18 LED : (16,2)

  • L319 : 19 LED : (17,2)

  • L320 : 20 LED : (18,2)

  • L321 : 21 LED : (19,2)

  • L322 : 22 LED : (20,2)

  • L323 : 23 LED : (21,2)

Access to the single LED tiles and by LED alias or the following GPIO line names:

  • alias led22 is LED Degrees Fahrenheit with GPIO line name DEGF

  • alias led23 is LED Degrees Celsius with GPIO line name DEGC

SIPO-MUX-GPIO for row 4 over SIPO-MUX-GP

 

sipo_mux_gpio_4: sipo-mux-gpio@4 {};

  • compatible = "sipo-mux-gpio";

  • offset = <96>;

  • ngpios = <24>;

sipo-mux-gpio@4

  • TMAM : 0 led24

  • TMPM : 1 led25

  • L402 : 2 LED : (0,3)

  • L403 : 3 LED : (1,3)

  • L404 : 4 LED : (2,3)

  • L405 : 5 LED : (3,3)

  • L406 : 6 LED : (4,3)

  • L407 : 7 LED : (5,3)

  • L408 : 8 LED : (6,3)

  • L409 : 9 LED : (7,3)

  • L410 : 10 LED : (8,3)

  • L411 : 11 LED : (9,3)

  • L412 : 12 LED : (10,3)

  • L413 : 13 LED : (11,3)

  • L414 : 14 LED : (12,3)

  • L415 : 15 LED : (13,3)

  • L416 : 16 LED : (14,3)

  • L417 : 17 LED : (15,3)

  • L418 : 18 LED : (16,3)

  • L419 : 19 LED : (17,3)

  • L420 : 20 LED : (18,3)

  • L421 : 21 LED : (19,3)

  • L422 : 22 LED : (20,3)

  • L423 : 23 LED : (21,3)

Access to the single LED tiles and by LED alias or the following GPIO line names:

  • alias led24 is LED Time AM with GPIO line name TMAM

  • alias led25 is LED Time PM with GPIO line name TMPM

SIPO-MUX-GPIO for row 5 over SIPO-MUX-GP

 

sipo_mux_gpio_5: sipo-mux-gpio@5 {};

  • compatible = "sipo-mux-gpio";

  • offset = <120>;

  • ngpios = <24>;

sipo-mux-gpio@5

  • CUP0 : 0 led26

  • CUP1 : 1 led27

  • L502 : 2 LED : (0,4)

  • L503 : 3 LED : (1,4)

  • L504 : 4 LED : (2,4)

  • L505 : 5 LED : (3,4)

  • L506 : 6 LED : (4,4)

  • L507 : 7 LED : (5,4)

  • L508 : 8 LED : (6,4)

  • L509 : 9 LED : (7,4)

  • L510 : 10 LED : (8,4)

  • L511 : 11 LED : (9,4)

  • L512 : 12 LED : (10,4)

  • L513 : 13 LED : (11,4)

  • L514 : 14 LED : (12,4)

  • L515 : 15 LED : (13,4)

  • L516 : 16 LED : (14,4)

  • L517 : 17 LED : (15,4)

  • L518 : 18 LED : (16,4)

  • L519 : 19 LED : (17,4)

  • L520 : 20 LED : (18,4)

  • L521 : 21 LED : (19,4)

  • L522 : 22 LED : (20,4)

  • L523 : 23 LED : (21,4)

Access to the double LED tile CountUp by LED alias or the following GPIO line names:

  • alias led26 is LED Count Up 0 with GPIO line name CUP0

  • alias led27 is LED Count Up 1 with GPIO line name CUP1

SIPO-MUX-GPIO for row 6 over SIPO-MUX-GP

 

sipo_mux_gpio_6: sipo-mux-gpio@6 {};

  • compatible = "sipo-mux-gpio";

  • offset = <144>;

  • ngpios = <24>;

sipo-mux-gpio@6

  • HLY0 : 0 led28

  • HLY1 : 1 led29

  • L602 : 2 LED : (0,5)

  • L603 : 3 LED : (1,5)

  • L604 : 4 LED : (2,5)

  • L605 : 5 LED : (3,5)

  • L606 : 6 LED : (4,5)

  • L607 : 7 LED : (5,5)

  • L608 : 8 LED : (6,5)

  • L609 : 9 LED : (6,5)

  • L610 : 10 LED : (8,5)

  • L611 : 11 LED : (9,5)

  • L612 : 12 LED : (10,5)

  • L613 : 13 LED : (11,5)

  • L614 : 14 LED : (12,5)

  • L615 : 15 LED : (13,5)

  • L616 : 16 LED : (14,5)

  • L616 : 16 LED : (15,5)

  • L618 : 18 LED : (16,5)

  • L619 : 19 LED : (16,5)

  • L620 : 20 LED : (18,5)

  • L621 : 21 LED : (19,5)

  • L622 : 22 LED : (20,5)

  • L623 : 23 LED : (21,5)

Access to the double LED tile Hourly by LED alias or the following GPIO line names:

  • alias led28 is LED Hourly 0 with GPIO line name HLY0

  • alias led29 is LED Hourly 1 with GPIO line name HLY1

SIPO-MUX-GPIO for row 7 over SIPO-MUX-GP

 

sipo_mux_gpio_7: sipo-mux-gpio@7 {};

  • compatible = "sipo-mux-gpio";

  • offset = <168>;

  • ngpios = <24>;

sipo-mux-gpio@7

  • AUT0 : 0 led30

  • AUT1 : 1 led31

  • L702 : 2 LED : (0,6)

  • L703 : 3 LED : (1,6)

  • L704 : 4 LED : (2,6)

  • L705 : 5 LED : (3,6)

  • L706 : 6 LED : (4,6)

  • L707 : 7 LED : (5,6)

  • L708 : 8 LED : (6,6)

  • L709 : 9 LED : (7,6)

  • L710 : 10 LED : (8,6)

  • L711 : 11 LED : (9,6)

  • L712 : 12 LED : (10,6)

  • L713 : 13 LED : (11,6)

  • L714 : 14 LED : (12,6)

  • L715 : 15 LED : (13,6)

  • L716 : 16 LED : (14,6)

  • L717 : 17 LED : (15,6)

  • L718 : 18 LED : (16,6)

  • L719 : 19 LED : (17,6)

  • L720 : 20 LED : (18,6)

  • L721 : 21 LED : (19,6)

  • L722 : 22 LED : (20,6)

  • L723 : 23 LED : (21,6)

Access to the double LED tile AutoLight by LED alias or the following GPIO line names:

  • alias led30 is LED Auto Light 0 with GPIO line name AUT0

  • alias led31 is LED Auto Light 1 with GPIO line name AUT1

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).

 

sipo_mux_display_8: sipo-mux-display@8 {};

  • compatible = "sipo-mux-display";

  • offset = <2 1>;

  • height = <7>;

  • width = <22>;

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 -d build/waveshare_pico_clock_green-helloshell bridle/samples/helloshell -- -DSHIELD="waveshare_pico_clock_green"
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.6.99

uart:~$ bridle version long
Bridle version 3.6.99.0

uart:~$ bridle info
Zephyr: 3.7.0-rc1
Bridle: 3.6.99

uart:~$ device list
devices:
- clock-controller@40008000 (READY)
- reset-controller@4000c000 (READY)
- snippet_cdc_acm_console_uart (READY)
- uart@40034000 (READY)
- timer@40054000 (READY)
- gpio@40014000 (READY)
- adc@4004c000 (READY)
- flash-controller@18000000 (READY)
- i2c@40048000 (READY)
- i2c@40044000 (READY)
- pwm@40050000 (READY)
- vreg@40064000 (READY)
- ds3231-mfd@68 (READY)
- ds3231-rtc (READY)
- spi@40040000 (READY)
- spi@4003c000 (READY)
- sipo-mux-gp@0 (READY)
- sipo-mux-gpio@7 (READY)
- sipo-mux-gpio@6 (READY)
- sipo-mux-gpio@5 (READY)
- sipo-mux-gpio@4 (READY)
- sipo-mux-gpio@3 (READY)
- sipo-mux-gpio@2 (READY)
- sipo-mux-gpio@1 (READY)
- sipo-mux-gpio@0 (READY)
- wpcg-gpio-leds (READY)
- ds3231-dts (READY)

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

More Samples

LED Blinky and Button

LED Blinky

See also Zephyr sample: Blinky.

west build -b rpi_pico -p -S usb-console -d build/waveshare_pico_clock_green-blinky zephyr/samples/basic/blinky -- -DSHIELD="waveshare_pico_clock_green"
west flash -r uf2 -d build/waveshare_pico_clock_green-blinky

LED ON/OFF by Button

See also Zephyr sample: Button.

west build -b rpi_pico -p -S usb-console -d build/waveshare_pico_clock_green-button zephyr/samples/basic/button -- -DSHIELD="waveshare_pico_clock_green"
west flash -r uf2 -d build/waveshare_pico_clock_green-button

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:

SET/FUNCTION : zephyr,code = <INPUT_KEY_ENTER>;
UP : zephyr,code = <INPUT_KEY_UP>;
DOWN : zephyr,code = <INPUT_KEY_DOWN>;
west build -b rpi_pico -p -S usb-console -d build/waveshare_pico_clock_green-input_dump zephyr/samples/subsys/input/input_dump -- -DSHIELD="waveshare_pico_clock_green"
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 … … … (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:

Rₗ : zephyr,user { io-channels = <&adc 0>; };
west build -b rpi_pico -p -S usb-console -d build/waveshare_pico_clock_green-drivers_adc zephyr/samples/drivers/adc/adc_dt -- -DSHIELD="waveshare_pico_clock_green"
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 … … … (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 -d build/waveshare_pico_clock_green-buzzer bridle/samples/buzzer -- -DSHIELD="waveshare_pico_clock_green"
west flash -r uf2 -d build/waveshare_pico_clock_green-buzzer

Simple test execution on target

  1. play a beep

  2. play a folk song

  3. 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.

Waveshare Pico Clock Green Display Test

The following samples work with the chosen display. That is:

LED : chosen { zephyr,display = &clock_display; };
SIPOMUX-DISPLAY : clock_display: &sipo_mux_display_8 {};
west build -b rpi_pico -p -S usb-console -d build/waveshare_pico_clock_green-display_test zephyr/samples/drivers/display -- -DSHIELD="waveshare_pico_clock_green"
west flash -r uf2 -d build/waveshare_pico_clock_green-display_test

References