Sunday 25 December 2022

Adafruit QT Py RP2040

Introduction

The Adafruit QT Py is a range of diminutive development boards. The QT Py pinout and shape is Seeed Xiao compatible and has castellated pads to allow it to be soldered to a PCB (note, some boards have components on the bottom of the board so will require a cut-out - this is one of them).

The boards have a QWIIC socket. It also has an RGB Neopixel.

Adafruit have released a version using the Raspberry Pi RP2040 processor (which requires a double-sided board to fit all the bits in the format).

It is quite a lot smaller than the Raspberry Pi PICO.
As you can see, the board, unlike the PICO is double sided. To solder it to another board, quite substantial cut outs would be required in the other board.

The QWIIC socket allows suitable I2C breakout boards to be connected without soldering. In this case a cable connected to the QT Py is connected to a PIMORONI BreakOut Garden adaptor (with a 1.12" OLED display).

Adafruit recommend CircuitPython but there is also an official MIcroPython port.However, there is little or no documentation on programming the board beyond that for a vanilla PICO.

Installing MicroPython

Download the UF2 file from the MicroPython site. If you are downloading onto a Windows machine, right click on the downloaded file, select Properties and Unblock 

Plug a USB A to USB C data cable into the board and the computer.

Hold the BOOTSEL button and press the RESET button.

The board will appear as a drive.

Copy the UF2 file to the board.

Once it has finished downloading, the board will restart.

Blink

The QT Py RP2040 has a Neopixel rather than the traditional LED on pin 13. This means that the normal Blink program does not work.

The CircuitPython UF2 specifically for the board has built in functions to operate the RGB Neopixel, and the board library has constants for the Neopixel pin.

I was unable to locate a Micropython example for the Blink program using a Neopixel.

Checking the pin-out https://learn.adafruit.com/assets/107201 shows that the RGB Neopixel is on pin 12, and the power for the Neopixel is on pin 11. To make the board more power efficient (useful for a battery powered application), the Neopixel can be unpowered in addition to not displaying a colour.

This requires both the Neopixel pin to be passed to the Neopixel constructor, and the power pin set to on.

Code

import time
import machine
import neopixel
# Set up a single Neopixel
pin = machine.Pin(12, machine.Pin.OUT)
pixel = neopixel.NeoPixel(pin, 1)
pixel.brightness = 0.3
# Set the power pin high to activate the Neopixel
power_pin = machine.Pin(11, machine.Pin.OUT)
power_pin.on()
def set_pixel(rgb):
    # Set the first pixel to rgb
    pixel[0] = rgb
    # Write the setting to the Neopixel
    pixel.write()
while True:
    # Set the first pixel to Red
    set_pixel((255, 0, 0))
    time.sleep(0.5)
    # Set the first pixel to off
    set_pixel((0, 0, 0))
    time.sleep(0.5)
    print("Blink!")


References

https://micropython.org/download/ADAFRUIT_QTPY_RP2040/

https://www.adafruit.com/category/1005

https://learn.adafruit.com/adafruit-qt-py/overview

https://shop.pimoroni.com/products/adafruit-qt-py-rp2040?variant=39341945487443

https://learn.adafruit.com/adafruit-qt-py-2040/blink

https://docs.micropython.org/en/latest/rp2/quickref.html#neopixel-and-apa106-driver

https://docs.micropython.org/en/latest/rp2/quickref.html#i2s-bus


 

Mac Mini (third generation - 2012)

This Mac Mini replaced a Windows XP machine when XP came out of support. I thought OS/X was more familiar than XP's replacement.

It is a 2012 third generation model. It has a two core 2.5GHz i5 processor, 4GB of RAM, and a 500GB hard drive.

The akuminium unibody design still looks stylish.

It has plenty of ports - left to right: power button, mains in, Gigabit Ethernet, FireWire 800, HDMI, Mini-DisplayPort, USB 3.0 ports, SDXC card slot, microphone, headphones.
This version theoretically could be upgraded. The memory used sockets and there was space to add a second hard drive (the server version came with a second drive already fitted).
The front is distinctly minimalist.

This too has now reached the end of support, and so is due for replacement.

Tuesday 20 December 2022

Adafruit MacroPad RP2040 Starter Kit

Adafruit MacroPad RP2040 contains a built in Raspberry Pi 2040 processor, 3x4 Neopixel RGB keypad, a rotary encoder and a STEMMA QT connector.

The rotary encoder also functions as the Pico's BOOTSEL button.
The RP2040 processor is just to the left of the display cable. Originally I thought this used a separate Raspberry Pi Pico board and so left this until I could get a Pico W with pre-soldered headers. Once I managed to buy one, I discovered it was complete.
There is  a QWIIC/STEMMA I2C on the right hand side of the board, plus a RESET button just above it. Below the first row of keys is a buzzer.
The Starter Kit has a decorated back plate, one side includes Voyager artwork.
The other side has artwork resembling the Apollo flight computer.
There is a reinforcing plate.
The kit includes four screws to hold the boards together, plus four feet and a rotary knob.



The device is programmable either using CircuitPython or Arduino.

PIMORONI Inky Pack with Raspberry Pi Pico W

 The PIMORONI Inky Pack is compact 296x128 pixel mono E Ink pack.

It has a socket for a Pico or Picow W, plus a Reset button.
The use of the the Inky Pack and a Raspberry Pi Pico W allows information to be obtained from outside sources and displayed on the Inky Pack. The E-Ink display only needs power when changing the display. Once changed, the display remains even when the power is removed (you may notice that there is no power cable in the photographs).

These are test runs with the data source being the BBC Weather RSS feed.

PIMORONI Plasma Stick 2040 W Christmas Lights

 So having played around with the Plasma Stick 2040 and run a web server on it, it was time to use it for Christmas lights

Initially the idea was to use the PICO W as an Access Point and control it via a web interface. This would make it independent of any local access point. Unfortunately there were some issues which I was unable to resolve before I needed to use the lights in the field. So to be able to change the lights a Rotary Encoder was plugged into the QWIIC socket via a Breakout Garden to QWIIC converter and a QWIIC cable.

For Christmas tree lights of course, the existing web server could have been used, time waits for no developer so it was used "as is".

In addition there is a Pimoroni Snowflake Solo on the tree.