Популярное

Raspberry Pi Pico Voltmeter - UART serial with the Pico and GUI application in C/C++ and MicroPython

449 Просмотры
Издатель
This shows the Raspberry Pi and Raspberry Pi Pico working together over a UART serial connection. The Pico uses the built in analog to digital converter (ADC) to measure a voltage on one of it's gpio pins. It then uses either C/C++ or MicroPython code to send that to the Raspberry Pi using a serial uart connection. Once received on the Raspberry Pi it uses Python Pygame Zero to create a graphical user interface (GUI) which displays the voltage reading using a 7-segment display font.


The project is a bit different than I originally planned. I was hoping to use I squared C or possibly SPI to communicate between the Raspberry Pi and the Raspberry Pi Pico, but I ended up using UART serial instead. That’s not a problem with this example, but I’ll explain the reason for that in the video. I hope to look at the other protocols in a future video.

The video briefly covers how to setup MicroPython, although that was explained in more details in my earlier introductory video: https://youtu.be/lQVIjC_N8Tc

It does go into a bit more detail on setting up the C/C++ Tool chain, which is actually quite straight forward on the Raspberry Pi. It then shows how you can compile the code ready to transfer to the Pico using the BOOTSEL button.

More details and to download code: http://www.penguintutor.com/projects/pico


Chapters:
00:00 Introduction to Voltmeter project
01:30 C/C++ or MicroPython
02:34 Serial data protocols UART/SPI/I2C
03:45 Setting up MicroPython - why can't use UART0
04:20 Setup C/C++ for the Pico
05:35 Introduction to voltmeter and ADC
07:02 Wiring up the Raspberry Pi to the Pico for UART 1
07:46 ASCII Text transfer between Pi and Pico
08:20 Code for Pico in MicroPython
09:55 C/C++ code for the Pico
15:00 Python Pygame Zero code on the Raspberry Pi
20:27 Demo of working voltmeter
21:19 Suggestions for improvements
22:30 Summary
Категория
Язык программирования C++
Комментариев нет.