Gyro-Controlled Labyrinth Game Outputs To VGA

This gesture-controlled labyrinth game using two Raspberry Pi Pico units does a great job of demonstrating how it can sometimes take a lot of work to make something look simple.

To play, one tilts an MPU6050 inertial measurement unit (IMU) attached to one Pico to guide a square through a 2D maze, with the player working through multiple levels of difficulty. A second Pico takes care of displaying the game state on a VGA monitor, and together they work wirelessly to deliver a coherent experience with the right “feel”. This includes low latency, simulating friction appropriately, and more.

Taking a stream of raw sensor readings and turning them into control instructions over UDP in a way that feels intuitive while at the same time generating a VGA display signal has a lot of moving parts, software-wise. The project write-up has a considerable amount of detail on the architecture of the system, and the source code is available on GitHub for those who want a closer look.

We’ve seen gesture controls interfaced to physical marble mazes before, but two Raspberry Pi Picos doing it wirelessly with a VGA monitor for feedback is pretty neat. Watch it in action in the video, embedded just under the page break.

Continue reading “Gyro-Controlled Labyrinth Game Outputs To VGA”

Raspberry Pi Pico Becomes MIDI-Compatible Synth

ECE 4760 is a microcontroller course that runs at Cornell every year, and it gives students a wide remit to pursue various kinds of microcontroller projects. [Pelham Bergesen] took the class and built himself a MIDI-controllable synthesizer out of a Raspberry Pi Pico.

[Pelham] coded a library to parse MIDI messages on the Pico, with the microcontroller’s UART charged with receiving the input data. MIDI is basically just serial at a baud rate of 31.25k, with a set message structure, after all. From there, the Pico takes the note data and plays the relevant frequencies by synthesizing square waves using a PWM output. A second PWM channel can also be blended with the first to generate more complex tones.  The synthesizer is designed to be used with a source of MIDI note data such as a keyboard controller; [Pelham] demonstrates the project in use with a Roland JD-XI. It’s a fairly basic synthesizer, but [Pelham] does a good job of explaining all the steps required to get this far. If you’ve never done an audio or MIDI project before, you might find his guide very helpful for the way it steps through the basics.

[Pelham] didn’t get to implement fancier features like direct digital synthesis (DDS) or analog audio effects before the class closed out. However, that would be an excellent project for anyone else developing their own Pico synthesizer. If you whip up something that sounds good, or even just interesting, be sure to notify us on the tipsline. Video after the break.

Continue reading “Raspberry Pi Pico Becomes MIDI-Compatible Synth”

PicoDebugger Makes Development Easier

Debugging a Raspberry Pi Pico is straightforward enough; it simply involves hooking up something up to the USB and SWD pins. [Mark Stevens] whipped up the PicoDebugger to make this job easier than ever before.

The Raspberry Pi Foundation developed the Picoprobe system to allow a RP2040 to act as a USB to SWD and UART bridge for debugging another Pico or RP2040. The problem is that hooking it up time and time again can be fussy and frustrating.

To get around this, [Mark] whipped up the PicoDebugger board, which directly connects most of the important pins for you. Drop a Pico into the “Target” slot, and you can hook up the PicoDebugger to its UART lines with the flick of a DIP switch. The SWD pins can then also be connected via jumpers if so desired.  It also features a 2×20-pin header to allow the target to be wired into other hardware as necessary.

It’s a neat project, and it certainly beats running a bird’s nest of jumper wires every time you want to debug a Pico project. Simply dropping a board in is much more desirable.

We’ve seen some other neat debug tools over the years, too. If you’ve got your own development productivity hacks in the works, don’t hesitate to let us know!

A BASIC Interpreter For The Raspberry Pi Pico

It’s pretty easy to program the Raspberry Pi Pico in Python, or you can use C or C++ if you so desire. However, if you fancy the easy language of yesteryear, you might like PiccoloBASIC from [Gary Sims].

Putting it simply, piccoloBASIC is a BASIC interpreter that runs on the Raspberry Pi Pico. It features all the good bits of BASIC such as GOTO and GOSUB commands, that fancier languages kind of look down upon. It’s also got enough built-in routines to handle regular programming life, like sleeps, delays, a basic pseudorandom number source, trigonometric functions, and the ability to deal with floating point numbers. As far as microcontroller tasks go, it’s got rudimentary support for talking to GPIOs right now via the pinon and pinoff commands. However, it’s probably not the way to go if you want to bit-bang an SD card to within an inch of its speed rating.

Down the road, [Gary] hopes to add support for features like the Pico’s I2C, SPI, and PIO hardware, along with networking protocols and Bluetooth. PEEK and POKE are also hopefully on the way for those that like to fiddle with memory directly.

Meanwhile, if you’re looking for a different yet similar take, explore the port of MMBasic to the Pico platform. Video after the break.

Continue reading “A BASIC Interpreter For The Raspberry Pi Pico”

A Pico-Based ZX Spectrum Emulator

The ZX Spectrum was a popular computer of the 8-bit era. Now, it’s possible to emulate this machine on a microcontroller so cheap that it’s literally been given away on the front cover of magazines. Yes, we’re talking about the Pico ZX Spectrum project.

The project consists of all the necessary code to emulate a ZX Spectrum upon the hardware of the RP2040 microcontroller that makes up the Raspberry Pi Pico. The community has then taken this code and run with it, using it as the basis for all manner of different ZX Spectrum builds. If so desired, you can go barebones and use the Pico to run a ZX Spectrum off a breadboard with HDMI video output. Alternatively, you can build something like the PicoZX from [Bobricius]. The handheld computer features a PCB-based housing, along with an LCD and an integrated keyboard. Other configurations support features like USB keyboards, VGA outputs, and working sound output.

It’s great to see a classic 8-bit computer reimagined in all kinds of new tribute form factors. The Spectrum was always beloved for its neat all-in-one design, and there are several modern remixes that riff on that theme. The fact that they can all be powered by a cheap single-board microcontroller is all the more astounding. Video after the break.

Continue reading “A Pico-Based ZX Spectrum Emulator”

Pi Microcontroller Still Runs A Webserver

At first glance, the Raspberry Pi Pico might seem like a bit of a black sheep when compared to the other offerings from the Raspberry Pi Foundation. While most of the rest of their lineup can run Linux environments with full desktops, the Pico is largely limited to microcontroller duties in exchange for much smaller price tags and footprints. But that doesn’t mean it can’t be coerced into doing some of the things we might want a mainline Pi to do, like run a web server.

The project can run a static web page simply by providing the Pico with the project code available on the GitHub page and the HTML that you’d like the Pico to serve. It can be more than a static web page though, as it is also capable of running Python commands through the web interface as well. The server can pass commands from the web server and back as well, allowing for control of various projects though a browser interface. In theory this could be much simpler than building a physical user interface for a project instead by offloading all of this control onto the web server instead.

The project not only supports the RP2040-based Raspberry Pi Pico but can also be implemented on other WiFi-enabled microcontroller boards like the ESP8266 and ESP32. Having something like this on hand could greatly streamline smaller projects without having to reach for a more powerful (and more expensive) single-board computer like a Pi 3 or 4. We’ve seen some other builds on these boards capable of not only running HTML and CSS renderers, but supporting some image formats as well.

Continue reading “Pi Microcontroller Still Runs A Webserver”

A Smart Home That CAN Do It All

In an ideal smart home, the explosion of cheap WiFi and Bluetooth chips has allowed hundreds of small wireless devices to control the switches, lights, and everything else required for a “smart home” at a relatively low price. But what if you don’t want hundreds of internet-connected devices in your home polluting the wireless spectrum and allowing potential security holes into your network? If you’re like [Lucas Teske], you might reach for something wired and use cheap and (currently) available Raspberry Pi Picos to create PicoHome.

The unique twist of PicoHome is that it uses a CAN bus for communication. One of [Lucas’] goals was to make the boards easily swappable when hardware failed. This meant board-to-board communication and protocols like I2C were susceptible to noise (every time a relay triggered, the bus would lock up briefly). The CAN bus is designed to work in an electrically noisy environment.

There are two parts to the system: pico-relay and pico-input. The first connects to a 16 relay board and can control 16 different 24v relays. The second has 16 optoisolators to read from 12v-24v switches and various buttons throughout the house. These can be placed in a giant metal box in a central wiring location and not worry about it.

The firmware and board files are all released under an Apache 2.0 license, but the CAN2040 library this project relies on is under GPL. We covered the CAN2040 library when it was first released, and it’s lovely to see it being used for something entirely unexpected.

Continue reading “A Smart Home That CAN Do It All”