Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 1587

Python • Re: HC-SR04 ultrasonic sensor

$
0
0
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)    time.sleep(1)    n=n+1

Statistics: Posted by neilgl — Thu Dec 21, 2023 8:12 pm



Viewing all articles
Browse latest Browse all 1587

Trending Articles