Things used in this project

Hardware components:
Bolt 6 nzcjro4zrr
Bolt IoT Bolt WiFi Module
×1
Adafruit industries ada1536 image
Buzzer
×1
826 04
Male/Female Jumper Wires
×2
Adafruit industries ada592 image 75px
USB-A to Micro-USB Cable
×1
Software apps and online services:
Bolt cloud wp8fq9i8ew
Bolt IoT Bolt Cloud
Bolt IoT Bolt Python Library

Code

crypto_alert.pyPython
import json
import requests
import time
from boltiot import Bolt



SELLING_PRICE  =  17082.93

API_KEY = "your_api_key"
DEVICE_ID  = "your_device_id"
bolt = Bolt(API_KEY, DEVICE_ID)


def price_check():
    url = "https://min-api.cryptocompare.com/data/price"

    querystring = {"fsym":"BTC","tsyms":"USD"}

    response = requests.request("GET", url, params=querystring)
    response = json.loads(response.text)
    current_price = response['USD']
    return current_price

while True:
    market_price = price_check()
    print "Market price is", market_price
    print "Selling price is", SELLING_PRICE
    time.sleep(4)
    if market_price > SELLING_PRICE:
        bolt.digitalWrite("0", "HIGH")
        time.sleep(60)
        bolt.digitalWrite("0", "LOW")

Credits

Picture?width=200&height=200
Rahul Singh
5 projects • 8 followers
Software Developer at Bolt IoT
Contact

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Sign up / LoginProjectsPlatformsTopicsContestsLiveAppsBetaBlog