Bitcoin project using html

@rahul.singh1
@yeshwant.naik
@vinayak.joshi
How am I supposed to write bitcoin project code in html using js screen shot of the code is provided below which is done by me and its incomplete and I’m confused on how buzz the buzzer.
Need help ASAP.



Hi @samir25011,

Can you post your code here so that I can edit it . To post the code use ```` on new line

You need to add another if else statement in your js code, to check if the value crosses the threshold. If yes use digitalWrite(0, ‘HIGH’) to buzz the buzzer. Make sure your hardware configuration for the buzzer is correct. It should be:

  1. Take your bolt wifi module make a connection from small pin of buzzer to GND of bolt module with the use of male female connecting wire.
  2. Take another wire and longer pin buzzer to GPIO 0 of bolt module
  3. Give power supply while using usb cable.

@rahul.singh1
@vinayak.joshi

<html>
<head>
    <title>Bitcoin Alert System</title>
    <script type="text/javascript" src="https://cloud.boltiot.com/static/js/boltCommands.js"></script>
    <script>
        setKey('{{ApiKey}}','{{Name}}');
    </script>
</head>
<body bgcolor="#89f1b6">
    <script language= "javascript" type="text/javascript" >
        function bitcoin_price(){
            var xhttp = new XMLHttpRequest();
            xhttp.onreadystatechange = function() {
                if (this.readyState == 4 && this.status == 200) {
                    document.getElementById("demo").innerHTML = this.responseText;
                    var obj = JSON.parse(xhttp.responseText);
                    return obj;
                }
            };
            xhttp.open("GET", "https://min-api.cryptocompare.com/data/price?fsym=BTC&tsyms=USD", true);
            xhttp.send();
        }
    </script>
    Enter Selling price:<input type="text" value="0"><br>
    <p id="demo">Market price</p>
    <center>
        <button onclick="bitcoin_price()" style="font-size: 15px; font-weight: bold;">Submit</button>
    </center>
</body>