Tutorial: Retrieve Latest Bitcoin Price Using Dot One and TFT
In this tutorial , we will be making a Bitcoin Tracker using a Dot One and displaying the bitcoin latest price to the TFT screen.

Figure 1
What you will need:
Preparations :
- Create an account at Wia if you haven't already - refer to this tutorial to get started with Wia here.
- Set up your Dot One
You will need to have a set up Dot One and you can find the tutorial on how to do that Here.
- Set up your code project
Now you will need to create a space and then a code project on your Wia Dashboard
Once you have finished the tutorials above and learned all about the Dot One , you are all set to do this tutorial below.
Writing Code
- Note: This portion requires a decent background in coding, specifically in C++ in order to understand how the Dot One and TFT Screen work to print the prices
- Below is the code for this project which you can follow by reading the comments attached to the side of the code.
- Feel free to try and rewrite this code yourself so you can better understand the device! Some advice if you are having trouble is to make a temporary Block Project and take note of what code is pasted into the preview window when you drag certain blocks over!
#include <WiFi.h>
#include <Adafruit_GFX.h>
#include <Adafruit_ST7735.h>
#include <SPI.h>
#include <Wia.h>
#define TFT_RST -1
#define TFT_CS 16
#define TFT_DC 17
Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST);
Wia wiaClient = Wia();
int i = 0;
String price = "";
String previous = "";
int iterator = 0;
void powered_by() { // this is a function which is used to display the header "Powered by: Wia Dot One"
// each of these sections is specific to different texts which are printed in the TFT screen
// as you can see each time for new text we define where the text starts, the color, the size and rotation
tft.setCursor(5, 5); // this function moves where this snipet of text "Powered by:" is
tft.setTextColor(ST7735_BLACK); // this functioin changes the color of the text "Powered by:"
tft.setTextSize(1); // this defines the size of the text "Powered by:"
tft.setRotation(1); // this sets the rotation of the text "Powered by:"
tft.println("Powered by:"); // this displays the text "Powered by:" with the settings defined above
// the following 4 sections of code work the same but are for different pieces of text.
tft.setCursor(5, 20);
tft.setTextColor(ST7735_BLACK);
tft.setTextSize(2);
tft.setRotation(1);
tft.println("Wia");
tft.setCursor(15, 8);
tft.setTextColor(ST7735_YELLOW);
tft.setTextSize(2);
tft.setRotation(1);
tft.println(".");
tft.setCursor(43, 20);
tft.setTextColor(ST7735_YELLOW);
tft.setTextSize(2);
tft.setRotation(1);
tft.println("Dot");
tft.setCursor(85, 20);
tft.setTextColor(ST7735_YELLOW);
tft.setTextSize(2);
tft.setRotation(1);
tft.println("One");
tft.setCursor(50, 55);
tft.setTextColor(ST7735_BLACK);
tft.setTextSize(2);
tft.setRotation(1);
tft.println("Price:");
tft.setCursor(3, 80);
tft.setTextColor(ST7735_BLACK);
tft.setTextSize(2);
tft.setRotation(1);
tft.println("$");
}
void setup()
{
WiFi.begin();
delay(2500);
tft.initR(INITR_144GREENTAB);
tft.fillScreen(ST7735_WHITE);
}
void loop()
{
if(previous != wiaClient.getDeviceState("Bitcoin_Latest") || i == 0)
{
tft.setCursor(15, 80);
tft.setTextColor(ST7735_WHITE);
tft.setTextSize(2);
tft.setRotation(1);
tft.println(previous);
tft.setCursor(15, 80);
tft.setTextColor(ST7735_BLACK);
tft.setTextSize(2);
tft.setRotation(1);
tft.println(wiaClient.getDeviceState("Bitcoin_Latest")); // BTC
previous = wiaClient.getDeviceState("Bitcoin_Latest");
tft.setCursor(3, 55);
tft.setTextColor(ST7735_ORANGE);
tft.setTextSize(2);
tft.setRotation(1);
tft.println("BTC");
powered_by();
}
i++;
delay(3600000);
}
Create a Flow
Navigate to the flow tab on the Wia platform and set up a new flow .
This flow will do all the back end heavy lifting for us from creating an http request to retrieve the bitcoin latest price from an api , parse the resulting response and update the state
This flow comprises of Four nodes:
- First drag the “Timer” node in the trigger tab to the editor and configure it’s settings to "trigger" every minute.

- Next, drag the "HTTP Service" node under the service tab to the editor and edit its configurations so as to resemble below.

This node essentially just makes a http request and returns the response from the api , this particular request api doesn't need any headers.
- Next, drag the "Run Function" node over to the editor from under the logic tab and configure the code to look like image below

This code essentially just uses JSON to parse the response from the http request and takes the last value in the response as this is the current value of Bitcoin price in US Dollars.
- Last node , we are going to drag to the editor is the "Update State" node from the Logic tab and layout the options like so :

This node basically allows the user to either update the incoming state or update another device's state.
- Lastly, link the nodes together and away you go , you have now got a working Bitcoin Tracker directly displaying on your TFT screen
Congratulations and Well Done on completing the tutorial , hope you enjoyed it.
Here's another to keep you entertained -
Get the beer of the day to display on your TFT screen
If you are more into building and making your own electronic devices and hooking them up to the cloud , why not out some of these tutorials
Coffee Counter with TFT Screen and Button
Slack Toggle Presence with Wia Button Module and Dot One
or build something from our hackster projects
Wia Hackster Projects