Thanks for a nice tutorial. I'm just wondering. Can your code be modified to count pulses from a anemometer? There are like 20 pules in one revolution.
Yes, but I find you need a dedicated device just to do that or the results are not very accurate. I have a few videos from this one to one about ultrasonic measurement, and they all have accuracy problems if you ask the microcontroller to do more than count.
@@tsbrownie One more question, tsbrownie. In your comment, the code, where # Pin 7 = 3,3V photodiode OFF. Maybe I don't get it, but how come the photodiode is off when detecting HIGH on pin 7? ( after interrupt on rising ).
@@geirha75 It's been a long time so I'm not sure, but if I remember correctly., it works backward from what you expect. It's an easy experiment to try both ways to see.
Just to be clear... There is no way that GPIO.input(channel) result be anything else except 0 or 1 (True/False), right? Can't be (in any circumstances) betveen 0 and 1?
It should be true or false (0 or 1). But since you don't know the logic / code behind the test, you can not say for sure there is "no way" for it to be other. Python is famous for its approximate math. I have some videos on that also. Why risk crashing a billion dollar lander over some little oddity in the code? It happens.
Wow... thinking outside the box... The only way i can think of achieving this will be to print the count to serial, then use some kind of application to stream/save the serial data to mysql database.