Raspberry Pi Pico
Connecting Over UART
This is part of a much larger project that I have yet to complete. It does give proof of concept to the idea though and so I have included it here.
The micro:bit has the ability to communicate wirelessly with other micro:bits using bluetooth radio. I have accumulated a decent number of micro:bits over the years and have found them easy to use in various projects for remote controlling cars and other circuits. This project was a simple test of whether or not one of the micro:bits in a pair could be connected directly to the Pico and use UART to communicate some information.
Using the Pinbetween, I have connected pin0 of the micro:bit (tx) to GP5 of the Pico (rx). I am communicating in a single direction for this project. I have also connected GND on the micro:bit to GND on the Pico. I have powered the micro:bit independently although if you are only using the micro:bit by itself here, and not using a lot of juice from the 3V3 pin on the Pico, you could probably use that. In a robot vehicle circuit, you tend to power motors directly from batteries rather than from the regulated 3V3 supply anyway.
This was the code I put on the micro:bit for test purposes.
from microbit import * uart.init(baudrate=9600, tx=pin0) c = 65 while True: uart.write(chr(c)) sleep(1000) c += 1 if c > 90: c = 65
This was the receiving code that I put on the Pico,
from machine import Pin, UART from time import sleep uart = UART(1, baudrate=9600, rx=Pin(5)) while True: if uart.any(): d = uart.read() d = d.decode("utf-8") print(d) sleep(0.1)
Future Plans
This worked quite nicely. This opens up the possibility of setting up projects that use a combination of micro:bits and Picos to take advantage of the built-in bluetooth radio. In this page, I used MicroPython. You could, of course, use MakeCode too if you preferred.