Posts

Showing posts with the label Python

MicroPython Module for the MMA8452 Accelerometer

Image
The  MMA8452 sensor is a three axis accelerometer with additional functions to simplify its use. In this post we are taking a quick look at it and making a MicroPython module to use it.

Using the PIO to Interface with the DHT11 and DHT22 sensors

Image
The DHT11 and DHT22 are popular sensors for measuring temperature and humidity. While connecting these sensors to a microcontroller is very simple, communicating with them demands generating and measuring times of the order of microseconds. Let's see how the RP2040's PIO can help us.

Project: Making a Timer with the Raspberry Pi Pico

Image
 Here is a simple and fun project: a countdown timer using an RGB LED rings and a Pi Pico. The assembled timer (this was first posted in my  Portuguese blog  in July 20, 2021)

Using the PIO to interface a HC-SR04 Ultrasonic Sensor

Image
The more I get to know the PIO, the more opportunities to use it I see. This time the device to interface is the well known HC-SR04 ultrasonic sensor .

MicroPython or CircuitPython?

Image
The Raspberry Pi Pico (and other RP2040 based boards) can be used with both MicroPython and CircuitPython. Let's look what they are and what is different between them.

Using the PIO to Interface a PS/2 Keyboard

Image
One of the most intriguing features of the RP2040 used in the Raspberry Pi Pico is the PIO - Programmable Input/Output . It allows us to execute small programs that handle digital input and output independently to the ARM Cortex M0+ Cores. For my first study of the PIO I decided to interface a PS/2 keyboard. In the past I have interfaced one of these keyboards to a Arduino Nano, reading the bits one by one in an interrupt generated by the clock signal. Using the PIO, the main processor will receive a complete byte in one go. An old but working PS/2 keyboard