Categories
Computing

Day 2: Hello Led

For Day 1, go here. The series is tagged advent-2025.

Box 1 contains a Pico, a USB lead and two breadboards:

Over in Micropython, the task is to light the LED on the board, configuring Thonny, etc along the way. Here in Yarg we need to:

  • Download the 0.2.1 release (yarg-lang-pico-0.2.1.tgz)
  • Uncompress the file (on a Mac, the finder will do that with a couple of double-clicks).
  • Connect the pico to the Mac holding down the bootsel button (see the linked PiHut guide above, if that’s unfamiliar. It’s harmless to try both – use their day 1 to explore, and then come back here to do Yarg Day 1)
  • Copy yarg-lang-pico-0.2.0.uf2 to the RPI-RP2 drive, and wait for the pico to restart:

Connect to the USB serial port it shares. Some exploring may be needed to find it in your serial program of choice. VS Code is a bit big to download, but seems to be free and available on all the PC platforms. The ‘Serial Monitor’ Extension seems to work well. Recent testing in putty on windows suggests Yarg doesn’t like that option (yet!)

‘Serial’ connected to Pico device (115200, 8N1, Local Echo, send CR+LF on return)

Type in, line by line, the hello_led example (I cut and paste from this post!)

const NUM_BANK0_GPIOS = 30;

place struct { uint32@0x014 gpio_out_set; uint32@0x024 gpio_oe_set; } @xd0000000 sio_hw;

place struct { struct { uint32 status; uint32 ctrl; }[NUM_BANK0_GPIOS] gpio; } @x40014000 io_bank0;

const pico_led = 0d25;
const gpio_field = 0x1 << pico_led;

const GPIO_FUNC_SIO = 0d5;

poke io_bank0.gpio[pico_led].ctrl, GPIO_FUNC_SIO;
poke sio_hw.gpio_oe_set, gpio_field;

poke sio_hw.gpio_out_set, gpio_field;

And the light will come on:

Box 1 completed! If you’d like to understand hello_led more, there is an annotated version.

Categories
Computing

A Maker Advent

I recently bought a maker calendar from ThePiHut (no relationship other than customer!). I went for the ‘Let it Glow‘ version. Hopefully I can post along this December, using Yarg to complete all the projects.

I have carefully made a release 0.2.0 which should have everything I need, but problem one was that I forgot to actually upload the release file when I made it. So there is no README with instructions in it.

So task one is to fix the bug! I think that’s checkout that tag, rebuild the release, and then upload the correct tarball!

From the series advent-2025