Tag Archives: MicroPython

Sending Data Over WiFi Between Raspberry Pi Pico W and Your PC

In this video lesson we show how we can send and receive data between the Raspberry Pi Pico W, and your PC. We will be running python on the PC, and we will exchange data using the UDP protocol. UDP is simple, and a very reliable way to send data packets back and forth. In this example, we will be demonstrating a simple Client Server relationship between the Pi Pico and PC using UDP over WiFi.

In this lesson, we will just be showing simple exchange of data, but in preparation for future lessons, go ahead and build this circuit.

Schematic for Circuit to Demonstrate a Client Server Example on Pi Pico

For your convenience, this is the “Server” software you will run on the Pi Pico.

Notice that the above code wants to load a “secrets” file that contain your WiFi name, and password

You should edit the code below with your WiFi username and your password, and then save the file in the Pi Pico lib folder, with the name secrets.py (don’t forget the .py)

Now, on the PC side, you will run your client, which will be run in Python. Here is the client software:

 

Measuring Roll, Pitch, and Yaw Using 3-Axis Gyro on the MPU6050

In this video lesson we describe how to measure roll, pitch, and yaw using the MPU6050. We describe the issues associated with drift in these gyros and will propose a path forward in dealing with the drift issue.

We are using the following circuit for this project:

Schematic for Creating a Tilt Meter

And this is the code we develop in today’s lesson.

 

LCD1602 Display Library for Micropython and the Raspberry Pi Pico W

This is some demonstration sample code showing use of the LCD1602 as an LCD display for the Raspberry Pi Pico W. The code is explained in the video above. It will prompt a user for his name, and then display a greeting on the LCD.

 

Below is the library for the Sunfounder Kepler Kit LCD1602 display. It allows the LCD display to operate with the Raspberry Pi Pico W. The code should be copied and pasted into Thonny, and then saved to your Raspberry Pi Pico W, to the same folder that contains you Python code. It MUST be saved with file name lcd1602.py