Skip to content

Instantly share code, notes, and snippets.

Created May 4, 2021 19:00
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
import time
import random
from adafruit_magtag.magtag import MagTag
magtag = MagTag()
key = "fontaine-status"
latest_id = ""
while True:
data = magtag.get_io_data(key)
# print(data)
feed = magtag.get_io_feed(key)
# print(feed)
send_value = random.randint(15,35)
some_value = data[-1]['value']
# print(some_value)
# using the internal "_get_io_client" seems to be the only way to do that ?
client =
last = client.receive_data(key)
the_id = last['id']
if the_id != latest_id:
print("New value:",last['value'])
latest_id = the_id
# magtag.set_text(f"{some_value}", index = 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment