Skip to content

Instantly share code, notes, and snippets.

@JasonPellerin
Last active August 29, 2015 14:19
Show Gist options
  • Save JasonPellerin/f07d4f1e91e5666483f4 to your computer and use it in GitHub Desktop.
Save JasonPellerin/f07d4f1e91e5666483f4 to your computer and use it in GitHub Desktop.
import requests
import serial
import time
s = serial.Serial('/dev/ttyACM0', baudrate=9600)
time.sleep(2)
if s.isOpen():
while (True):
r = requests.get('https://api.bitcoinaverage.com/ticker/USD')
r = r.json()
price = r['last']
print price
s.write(str(price))
s.write('\n')
time.sleep(25)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment