Python Forum
need help with ultrasonic sensor code
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
need help with ultrasonic sensor code
#2
After you press CTRL+C the while loop at line 46 will break and your function main() will exit. Then come this part:
if 0 < 10:
    os.system('. /home/pi/test.sh')
Where your script is called.
So if you want that the script runs along with the US sensor outputs, it has to be inside the while loop.
PS: This condition of your "if" will be always True.
Reply


Messages In This Thread
need help with ultrasonic sensor code - by mpmm366 - Jun-28-2018, 01:34 PM
RE: need help with ultrasonic sensor code - by gontajones - Jun-28-2018, 02:01 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  sensor code that starts heater chano 3 3,187 Jun-05-2019, 10:54 AM
Last Post: michalmonday
  Code Wireless Temperature sensor and send sensor readings to google sheet jenkins43 0 2,220 Nov-29-2018, 12:44 PM
Last Post: jenkins43
  RPi with IR Sensor pimlicosnail 1 2,223 Jun-24-2018, 08:53 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020