Hi Just looking for a simple program that I can count pulses per second on the GPIO pins, I have tried looking at RPM counters with no luck. I have successfully set the GPIO pins to outputs lighting up a led with success it is just reading the input on the GPIO pins I am having great trouble with. C...
Thanks, that works extremely well, easy program. Problem solved. :D :D :D :D :D :D Read the manual ( https://docs.python.org/2/library/time.html ) c = time.time() returns the time in seconds since the epoch as a floating point number. time.sleep(x) suspends execution of the current thread for the x ...
Hi Just checking the time function to sleep for 1 second gives a read out of "1506432732.6106627" Why would this not be accurate, should it be giving a result closer to one second.. I was hoping to use the time function to read the GPIO pins every one second when using it for measuring wind speed Th...
I have the two different sensors working on the same line with the code below running for more then 4 days without a problem. Maxim DS18B20+, Temperature Sensor -55 → +125 °C ±0.5°C 1-Wire TO-92, 3-Pin, RS Stock No. 540-2805 Maxim DS18B20+PAR Temperature Sensor, -55 → +125 °C, 3-Pin TO-92, RS Stock ...
Hi Is there any simple programs around to start a counter on the Raspberry PI. For example if a hall effect sensor or photocell, switch etc is connected to one of the GPIO ports it starts the counter or a time count until the sensor is activated again. I have looked around on the web, can not really...
Just reporting what I have succeeded in so far and extremely happy with the results. I have purchased DS18B20 and the DS18B20+Par. With the DS18B20+Par it dose give false readings, tried all sorts of ways of connecting, hardware and programing in python 3 and the DS18B20+Par still gives problems. No...
Hi When writing a simple program to a complex program and you know it works fine, when a "while True: is placed in the program so it will repeat all one gets is Unexpected Indent, this totally ruins the program. I could give several program examples, the trouble is python 3 seems to be showing this ...
It now works 100% without errors. :D Purchasing this item from Radio Spares appears to work fine and with any code from what I can fine. Maxim DS18B20+, Temperature Sensor -55 → +125 °C ±0.5°C 1-Wire TO-92, 3-Pin, RS Stock No. 540-2805 The problem is with this Maxim DS18B20+PAR Temperature Sensor, -...
I ran your code as instructed, thanks, still getting 85 error. import os import time import datetime import glob from time import strftime os.system('modprobe w1-gpio') os.system('modprobe w1-therm') #temp_sensor = '/sys/bus/w1/devices/28-00000781336e/w1_slave' device_file = "/sys/bus/w1/devices/28-...
Any programs that I run this error 85 all ways appears. This is the original code I used and the other codes still produce the same result. import os import time import datetime import glob from time import strftime os.system('modprobe w1-gpio') os.system('modprobe w1-therm') temp_sensor = '/sys/bus...
Well it would have been nice if you posted the errors you got instead of leaving us guessing. but looking at your posted code you did not make the changes required to use the code I posted. So I have done it for you import os import time import datetime import glob from time import strftime os.syst...
Hi Try replacing this section of your code def tempRead(): t = open(temp_sensor, 'r') lines = t.readlines() t.close() temp_output = lines[1].find('t=') if temp_output != -1: temp_string = lines[1].strip()[temp_output+2:] temp_c = float(temp_string)/1000.0 return round(temp_c,1) with this def read_t...
At which point in your code exactly do you get the "error" number? temp_output = lines[1].find('t=') if temp_output != -1: temp_string = lines[1].strip()[temp_output+2:] temp_c = float(temp_string)/1000.0 return round(temp_c,1) I'm not familiar with Python. Still, what exactly is returned if temp_o...
This is the code I am using, Python 3. import os import time import datetime import glob from time import strftime os.system('modprobe w1-gpio') os.system('modprobe w1-therm') temp_sensor = '/sys/bus/w1/devices/28-00000781336e/w1_slave' def tempRead(): t = open(temp_sensor, 'r') lines = t.readlines(...
I'm sure somewhere in some post a few month back, someone mentioned why this happens and it the basic 'driver code'. I think he wrote the micro:bit code used on them. But if your data shouldn't have an 85 reading, just throw it out straight after the reading so it doesn't interfere. To correct myse...
How have you got the sensor wired ? if you have it wired for parasite power it can cause this error. you should be powering it from 3.3v via 4.7k resistor https://thepihut.com/blogs/raspberry-pi-tutorials/18095732-sensors-temperature-with-the-1-wire-interface-and-the-ds18b20 Is your code checking t...
How have you got the sensor wired ? if you have it wired for parasite power it can cause this error. you should be powering it from 3.3v via 4.7k resistor https://thepihut.com/blogs/raspberry-pi-tutorials/18095732-sensors-temperature-with-the-1-wire-interface-and-the-ds18b20 Is your code checking t...
Hi I have the DS18B20 working extremely well, just occasionally error 85 appears. Is there any way of stopping this. All the connections are correct. only a 6 inch cable connected to the Pi. Out of 100 readings it will just appear about 5 times, but it can give false signals and interfere with the c...
Only using one Pi, this Mac laptop would just not want to hook up to the Pi. Tried the Pi on several computers and other networks not a problem, this Mac just refused to connect. Also what I noticed this Mac Laptop would not ping the Pi, but would ping Google or any other site. It was a school compu...