Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
Amisha Gupta
Published © GPL3+

Bitcoin Alert System! Your money Saver

Wanna know what's happening in Bitcoin world? Use this Bitcoin alert system to get all the updates related to it.

IntermediateProtip3 hours218
Bitcoin Alert System! Your money Saver

Things used in this project

Story

Read more

Schematics

setting of buzzer

Code

Code

Python
This is the code for getting sound of buzzer whenever bitcoin price exceeds a particular value
import json,configuration
import time
import requests
from boltiot import Bolt
mybolt=Bolt(configuration.API_KEY,configuration.DEVICE_ID)
selling_price=7000
def get_bitcoin_price():
 URL="https://min-api.cryptocompare.com/data/price?fsym=BTC&tsyms=USD"
 response=requests.request("GET",URL)
 response=json.loads(response.text)
 current_price=response["USD"]
 return current_price
while True:
 current_price=get_bitcoin_price()
 print("The current price is:",current_price)
 if current_price>selling_price:
  print("ALERT:current price has exceeded the selling price")
  response=mybolt.digitalWrite('0','HIGH')
  print(response)
 time.sleep(5)
 response=mybolt.digitalWrite('0','LOW')
 time.sleep(10)

Credits

Amisha Gupta
3 projects • 0 followers
Contact

Comments

Please log in or sign up to comment.