Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from phant import Phant
- from serial import Serial
- import time
- p = Phant('XGXqQ3maWluV1vn9xLgQ', 'moisture', private_key='REPLACEMEWITHPRIVATEKEY')
- s = Serial('COM3')
- last = None
- while True:
- line = s.readline()
- last = last or time.time()
- if time.time() - last > 15:
- last = time.time()
- print(line)
- m = int(line.decode().split('=')[1].strip())
- print(m)
- p.log(m)
- print(p.remaining_bytes, p.cap)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement