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 22, 2020
1 parent 0dffad5 commit 98063f9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pan-tilt-pi/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,12 @@
def on_message(client, userdata, message):
command = str(message.payload.decode("utf-8"))
update = json.loads(command)
payload = json.loads(messsage.payload) # you can use json.loads to convert string to json

logging.info(type(update))
logging.info(payload)
print(update)
print(payload)
logging.info("Bearing: $d" % update["bearing"])
if (update["bearing"] < 90):
logging.info("Setting Pan to: $d" % update["bearing"])
Expand Down

0 comments on commit 98063f9

Please sign in to comment.