Quantcast
Channel: Raspberry Pi Forums
Browsing all 1225 articles
Browse latest View live

Python • Re: HC-SR04 ultrasonic sensor

A test f-some-main.py file works for me with the sensor code saved as fSR04.py like this:Code: # f-some-main.pyimport timeimport fSR04 as srn=0while True: dist=sr.ping() print ("distance=",dist)...

View Article


Python • gpiozero and gpio 3 mystery...

If I use the following the leds light and go off as expected...Code: #!/usr/bin/python3import timefrom gpiozero import LEDpinList = [3, 4, 17, 27]led = [0] * len(pinList)for i in...

View Article


Python • Re: gpiozero and gpio 3 mystery...

Presumably something is or isn't being cleaned up when the LED object is redefined !?I see the same on my Pi5 running the latest Bookworm.At boot:Code: pi@raspberrypi:~ $ pinctrl get 3 3: no pu | --...

View Article

Python • Re: Program stops after initiated with CRONTAB - runs fine directly...

just tried that and still no change. When I comment out the email function, all works - so it is definitely on that one line of code....Statistics: Posted by TimFino — Sat Dec 23, 2023 12:18 am

View Article

Python • Can Minecraft Pi detect the player's velocity?

Hello, I am just wondering whever in minecraft pi (python) if there is a feature that can detect the player's velocity, as I would like a certain command to happen if the player slows down or stops. I...

View Article


Python • Re: Can Minecraft Pi detect the player's velocity?

I'd suggest you ask on the Minecraft Support site https://www.minecraft.net/en-us/edition/pi. You may find some players here that would know but this is not a Raspberry PI question but on a specific...

View Article

Python • HMC5883L heading

Hello, I would like to get a heading value from HMC5883L. The values I am getting are strange and unexpected. I am using the correct declination angle and there are no magnetic elements around the...

View Article

Python • Re: HMC5883L heading

I followed steps 3 and 5 in this tutorial https://www.instructables.com/Configure ... L-digital/, but it still failed. The problem is same as I mentioned above - sensitivity, the measured range from...

View Article


Python • Re: Django site with Apache WebServer not connecting to static files

Alias /static /home/pi/projects/monitorConditions/static<Directory /home/pi/projects/monitorConditions/static>Require all granted</Directory><Directory...

View Article


Python • DHT11 Pi 5

Hi! I'm trying to use DHT11 sensor with Pi 5 but it does not work since `RPi.GPIO` is not supported. How can i utilize gpiozero to get the sensor value? https://github.com/gpiozero/gpiozero/is ......

View Article

Python • Reading a DS18B20

I am reading 2 DS18B20 temperature sensors after using:Code: from ds18b20 import DS18B20and although it appears to read them alright, it keeps giving an error:Code: Index error: list index out of...

View Article

Python • Re: Reading a DS18B20

does the error say which file and line# the error is occuring on?Statistics: Posted by cleverca22 — Mon Dec 25, 2023 5:11 pm

View Article

Python • Re: DHT11 Pi 5

See viewtopic.php?t=359315Statistics: Posted by DS256 — Mon Dec 25, 2023 7:06 pm

View Article


Python • Re: Unexpected performance difference between picamera and picamera2..

FWIW, I'm using a PI Camera to take a JPG picture every 15 minutes. I noticed the Python Program taking up a lot of CPU time so I closed the camera connection in between shots and that reduced the...

View Article

Python • Re: how do I mix the code?

Extending python with cpp modules is possible and well documented.https://docs.python.org/3/extending/extending.htmlInstead of programming CRC on your own, look for the boost CRC module which might...

View Article


Image may be NSFW.
Clik here to view.

Python • begginer project RPG Maze -syntax error

i just started using the raspberry pi and i'm using the beginner guide book (4th edition) i'm getting a syntax error in the project RPG maze and i don't understand what is wrong. Could anyone take a...

View Article

Image may be NSFW.
Clik here to view.

Python • Re: begginer project RPG Maze -syntax error

Very easy to fix, you just need to read your code with attention and compare with the source code you're copying from.Your code is missing a "}" after the one the arrow is pointing to in this...

View Article


Image may be NSFW.
Clik here to view.

Python • Beginner project RPG maze

In this project you have to add a monster so when you go to the kitchen you loose but it shows the message then continues on (as in the attachment) does anyone know how to fix this?Statistics: Posted...

View Article

Python • TemperatureSensor class in picozero library reads high?

I've installed picozero into Thonny for a Pico W. The temperature sensor value is accessed as Code: temperature = pico_temp_sensor.tempThe value returned for temperature is around 33 at room...

View Article

Python • Re: Beginner project RPG maze

Can you say where the code comes from (link, github, or other)?Statistics: Posted by neilgl — Wed Dec 27, 2023 4:43 pm

View Article
Browsing all 1225 articles
Browse latest View live