Bitcoin Alert System


#1

Hello World!

While i was working on assignment bitcoin alert system where buzzer turns on for 5 secs and turn of after, i built up a code :

image

but when i run the code my buzzer doesnt turn on (below) :

image

i have checked my circuit connections and buzzer works completely fine through bolt cloud api.

Here is my cryptocompare api output :

Any ideas of where i maybe going wrong?
Any help appreciated, thanks :slight_smile:


#2

Hi @h4heet,

  1. Your code never reaches to the if condition, because after return statement, It will exit from the get_bitcoin_price function and will never reaches to the conditional part.
    Remove the return current_price line from your code.

  2. You have only declared the get_bitcoin_price function but you have not called it any where.

  3. Only write the controlling part in the while loop.

Refer this Bitcoin extracting cost of it

Also instead of sharing screenshot of the code, share your code so that I can edit/fix your code.

Also for debugging the issue, use a print statement to check the flow of the program.

Do let me know in case you need any other help.