Skip to content

Commit

Permalink
Update camera.py
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-iqt committed Dec 23, 2020
1 parent 398e20a commit 9d0f0b1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pan-tilt-pi/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,21 +74,21 @@ def moveCamera():
global actualTilt
while True:
if actualTilt != tilt:
logging.info("Moving Tilt to: %d"%actualTilt)
logging.info("Moving Tilt to: %d Goal: %d"%(actualTilt, tilt))
if actualTilt < tilt:
actualTilt += 1
else:
actualTilt -= 1
if actualPan != pan:
logging.info("Moving Pan to: %d"%actualPan)
logging.info("Moving Pan to: %d Goal: %d"%(actualPan, pan))
if actualPan < pan:
actualPan += 1
else:
actualPan -= 1
pantilthat.tilt(actualTilt)
#pantilthat.tilt(actualTilt)
pantilthat.pan(actualPan)
# Sleep for a bit so we're not hammering the HAT with updates
time.sleep(0.5)
time.sleep(0.05)
#############################################
## MQTT Callback Function ##
#############################################
Expand Down

0 comments on commit 9d0f0b1

Please sign in to comment.