Arduino bitcoin price display
Don't do that, it's not fair on the API provider, plus really it doesn't change that often: My Master's Class recently won one of several sponsor challenges in a french programming all-nighter competition similar to a hackathon, but not quite the same. Given we're nearly 30, it's no guarantee I'll get one, but if I do at least I have a good idea what one of my first projects could be: Non-USD currency data converted using hourly conversion rate from openexchangerates.
Future updates and ideas Now obviously I mentioned building an enclosure, but I have more screen to work with.
Maybe the next step is other currencies? I could find the value of my holdings? Perhaps show the value in red when it drops? What do you think? Please share your thoughts in the comments! To prevent the sketch from repeating itself every time, we should change the delay between one update and the next:.
Get the complete code in our GitHub repository and change the Wi-Fi name and password in the sketch to match your Wi-Fi networks credentials. Upload the code to the board and open the serial monitor. During the time of testing, the price was This information should also be shown on the OLED screen as shown in the image below: Now that the hardest and most important part of the project is done, we can now proceed to the easier part — adding alert LEDs.
We will add two LEDs to our setup that will indicate the price trend. Flashing the green LED will indicate that the price is going up, while flashing the red one will indicate that the price is going down. Adding the hardware to the project is simple. Your setup should look like this:. Apart from making changes to the hardware, you also need to tweak the code a little. You also need to define a variable to hold the previous price and the threshold of amount of change we need to flash the LEDs:.
In the loop section of the sketch check if it is the first time the code is being run. If it is, set previousvalue to be equal to the current Bitcoin price:. Check if the price went down by a value more or equal to the threshold. If it did, flash the red LED. You can now upload the updated project and see it in operation. Either of LEDs should flash quickly depending on the fluctuation in price. In this project, we have managed to do several things: There are many other things that you can do with this project.
For instance, you can tweak the setup to display the price of Bitcoin in more than one currency and add a switch button to change the displayed currency. Therefore, feel free and play around with the project and see what other cool stuff you can make it do. Simply click on the button below! Components Used in This Tutorial. Here is a list of the hardware requirements: The setup will look like this: Testing the Ticker Once you are satisfied with your hardware connections, start configuring your setup.
The first piece of code includes the required library files. Its URL is defined in the code like this: They include the name and password: First of all, we initialize the display: First we connect to the API server: String answer; while client. The next step is to extract the JSON answer from the raw data we have: You have successfully created your first physical Bitcoin ticker.
Your setup should look like this: If it is, set previousvalue to be equal to the current Bitcoin price: How to Go Further In this project, we have managed to do several things: Want to learn more?
Get my free eBook about the ESP! TicrThing 2 years ago.