Hello ! Thank you for making this video. This is one of the rare videos I saw on raspberry pi 5 GPIO projects. I just have one issue though. The code, while not giving any compiler time error, it doesn't work. The powershell just stays black, no values appear on the screen. I copied your code on my raspberry pi 5 and checked the GPIOs. It's still blank. The only part that I didn't do is the CMD part at the very end. I just run the code with the run button. Is there some way to fix this ?
@raspberrypimadeeasy6 ай бұрын
Hey @BradenNeighbor, Give this link a Read mesquite-bead-b16.notion.site/Read-Me-c99015f8dd4f48c6861445a952b40d56 If it still doesn't work Here are a few things you could check: Wiring: Please ensure that the wiring of the ultrasonic sensor to the Raspberry Pi is correct. The TRIG and ECHO pins should be connected to the correct GPIO pins on the Raspberry Pi. Sensor Functionality: Check if the ultrasonic sensor is working correctly. You can do this by testing the sensor on a different circuit or using a multimeter to check if it’s sending and receiving signals. Run in Terminal: You mentioned you didn’t use the CMD part at the end. It’s possible that the script might not run correctly if it’s not executed in a terminal. Try running the script directly from the terminal using the command python3 [script_name].py, replacing [script_name] with the name of your Python script. Permissions: Ensure the script has the necessary permissions to access the GPIO pins. You might need to run the script with sudo to give it these permissions. Python Version: Check if you are using the correct version of Python. This script should be run with Python 3. lgpio Library: Ensure that the lgpio library is correctly installed and working. You can test this by running a simple script that turns an LED on and off. Remember, it’s always important to troubleshoot step by step, checking the most likely issues first. I hope this helps! Let me know if you have any other questions.
@taseadrian64015 ай бұрын
Hello mate i did all the steps but gaved me the message "in import lgpio as GPIO" and is there anyway to do something? (And also is saying "No module named 'lgpio' ")
@raspberrypimadeeasy5 ай бұрын
It seems you’re encountering an issue with the ultrasonic sensor code on your Raspberry Pi 5. Import Error for ‘lgpio’: The error message “No module named ‘lgpio’” indicates that the lgpio module is missing. To resolve this, you can try using the gpiod library instead of RPi.GPIO. The Pi 5 uses gpiod for GPIO access. Install the lgpio package by running: pip install lgpio Update your code to use gpiod: Python import lgpio