But let’s try to do that later and make a new post of that test. That could be used for example in the garage to show the car distance to the wall. Now next we can try to modify the LED color, according to the distance, Green, Blue and to RED, when distance is low. Then it should work, and Raspberry Pico able to measure the distance values with the Ultrasonic sensor.įinally, this worked! Ultrasonic distance sensor started to give values better, after 5V DC supply was used. Then you need to use some resistors to make the returning “Echo” signal voltage smaller for the Pico Input pin. So in order to fix this issue, VBUS-pin needs to be used for taking power supply to the sensor. I found some information of this from Internet, other people having same issue. I suspect that the reason for this is, that the Ultrasonic sensor does not work with the 3,3V voltage, but 5V should be used. The idea would be to change the color of the LED strip, according to the measured distance.Ĭode was working and printing out the text to the shell, but the distance value was not working yet. I added the Ultrasonic distance sensor and RGB Led Strip, to test the Micro Python coding on Raspberry Pico device. Also you can use the debugger, to run the code line by line. At the bottom of the editor, is the MicroPython shell, where you can print stuff, like text and code variable values. If you need to stop the program, push the Red Stop button. Then you can press the green arrow button, to launch the code to run on the Raspberry Pico board. For example Ĭoding with the Thonny is similar as other code editors, you edit the code at the top area of editor. There is several guides in the Internet to do that. This guide will work on all variants of Raspberry Pi Pico at the time of publishing this guide, including the Raspberry Pi Pico W. We shall also learn to interface an OLED display and show the temperature values in it. If not, the micropython might not be installed to the Pico. First, we shall write a simple MicroPython script to display temperature values on a Serial data monitor. I usually do that as a root user, so it will have more access to the system, like the serial port, communicating to the Raspberry Pico board.įirst thing to check, is to select the board type from the Options/Interpreter menu.Īfter board is selected, Raspberry Pico board should communicate to the Thonny editor. Thonny can be installed to the Linux laptop easily with command pip3 install thonny.Īfter it is installed, it can be started from the Linux terminal by giving command thonny. Today I tested coding the Raspberry Pico board with Thonny Python code editor program.
0 Comments
Leave a Reply. |