The aim of this project is to create a "Fortnite LCD Stat Display" using the Wia platform and the Dot One. This project will enable you to view live stats about your Fortnite username such as Solo, Duo, Squad and all time stats which include K/D, kills, wins and score that you have.
List of items required to create this project:- Wia Dot One (Buy Yours Here)
- Dot One TFT LCD Screen Module (Buy Yours Here)
- FortniteTracker Account (Link)
- Fortnite Account
- Micro USB Cable
- Phone
- Computer
- 3D Printed Case (Optional) (Link)
- 2x M5 25mm Bolt
- 2x M5 Nut
Create a Wia account with the Dot One connected. If you haven’t done so yet, you can follow this tutorial over here.
Step 2:Login To Your Fortnite Tracker Account [Link].
Step 3:Click on this URL.
You will then see a red button with "Create Application" text. Click on it.
Proceed by typing in the "App Name", "Description" and "Email Address". Once completed press the red "Create app" button on the bottom right side of the screen
A Box with an API-Key will appear on your screen below the Identifiers Section. Save that key for later as we will be needing it.
Click on this URL and under "Get Fornite BR Player Stats" copy the url after "GET". Replace the {platform} text in the URL with the platform of your choice (PC = 'PC', Xbox One = 'xb1', PlayStation = 'psn') and the {epic-nickname} with the name of your fortnite character.
Open dashboard.wia.io and select your space. Click on the flows Icon. Create a new flow using the blue "Create a Flow" button. Give your flow a name and press the blue button "Create flow".
Step 8:Drag the nodes from the left side of the screen so that they look like this. Link them together according to the image.
In the "Timer" node, select "Every 5 Minutes" and update the node.
In the "HTTP Service" Node Select "GET" from the method, Paste the customised URL from Step 6 into the URL box, Type in "TRN-Api-Key" into the Header Key and the API-Key from Step 5 into the Value Box. Update the Node.
In the Run function Node Paste this Code and save the Node.
var kd_lifetime = JSON.parse(input.body).lifeTimeStats[11].value; //KD LIFETIME
var kills_lifetime = JSON.parse(input.body).lifeTimeStats[10].value; //KILLS LIFETIME
var wins_lifetime = JSON.parse(input.body).lifeTimeStats[8].value; //WINS LIFETIME
var score_lifetime = parseFloat(JSON.parse(input.body).lifeTimeStats[6].value.replace(/,/g, '')); //SCORE LIFETIME
var kd_solo = JSON.parse(input.body).stats.p2.kd.value;
var kills_solo = JSON.parse(input.body).stats.p2.kills.value;
var wins_solo = JSON.parse(input.body).stats.p2.top1.value;
var score_solo = JSON.parse(input.body).stats.p2.score.value;
var kd_duo = JSON.parse(input.body).stats.p10.kd.value;
var kills_duo = JSON.parse(input.body).stats.p10.kills.value;
var wins_duo = JSON.parse(input.body).stats.p10.top1.value;
var score_duo = JSON.parse(input.body).stats.p10.score.value;
var kd_squad = JSON.parse(input.body).stats.p9.kd.value;
var kills_squad = JSON.parse(input.body).stats.p9.kills.value;
var wins_squad = JSON.parse(input.body).stats.p9.top1.value;
var score_squad = JSON.parse(input.body).stats.p9.score.value;
output.body = kd_lifetime+'/'+kills_lifetime+'/'+wins_lifetime+'/'+score_lifetime+'/'+kd_solo+'/'+kills_solo+'/'+wins_solo+'/'+score_solo+'/'+kd_duo+'/'+kills_duo+'/'+wins_duo+'/'+score_duo+'/'+kd_squad+'/'+kills_squad+'/'+wins_squad+'/'+score_squad;
Step 12:Click on the Code Icon on the left side of the Wia dashboard and Create a code project. Give your project a name and click on "Code Project". Paste the code found underneath to the code editor and upload your code to the device using.
#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();
const unsigned char icon [] PROGMEM = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x80, 0x00, 0x40, 0x00, 0xe0, 0x1f, 0x07, 0xf0, 0x1e, 0x00, 0x31, 0xf1, 0xe3, 0x00, 0x18, 0x03,
0x80, 0x00, 0xa0, 0x00, 0xe0, 0x1e, 0x01, 0xf0, 0x06, 0x00, 0x31, 0xf1, 0xe3, 0x00, 0x18, 0x03,
0x80, 0x01, 0x10, 0x00, 0xe3, 0xfc, 0x78, 0xf1, 0xc7, 0xe3, 0xf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0x8f, 0x8f, 0x8f, 0xfe, 0x3f, 0xfc, 0x08, 0x18, 0x3f,
0xbc, 0xf3, 0xcf, 0x3c, 0xe0, 0x1f, 0x8f, 0x8f, 0x8f, 0x8f, 0xc0, 0x3f, 0xfc, 0x1c, 0x18, 0x3f,
0xbc, 0xf3, 0xcf, 0x3c, 0xe0, 0x7f, 0x8f, 0x8f, 0x8f, 0x8f, 0xc0, 0xff, 0xfe, 0x1c, 0x38, 0x3f,
0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x3e, 0x38, 0x3f,
0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x7c, 0x7f,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
};
float kd_lifetime, kills_lifetime, wins_lifetime, kd_solo, kills_solo, wins_solo, kd_duo, kills_duo, wins_duo, kd_squad, kills_squad, wins_squad, score_lifetime, score_solo, score_duo, score_squad;
int firstSlash, secondSlash, thirdSlash, fourthSlash, fifthSlash, sixthSlash, seventhSlash, eighthSlash, ninethSlash, tenthSlash, eleventhSlash, twelvethSlash, thirteenthSlash, fourteenthSlash, fifteenthSlash;
int state = 1;
const int tftButtonA = 19;
const int tftButtonB = 21;
void setup() {
WiFi.begin();
delay(2500);
tft.initR(INITR_144GREENTAB);
}
void loop() {
String data=wiaClient.getDeviceState("fortniteData");
kd_lifetime = data.toFloat();
firstSlash = data.indexOf("/");
kills_lifetime = data.substring(firstSlash+1).toFloat();
secondSlash = data.indexOf("/",firstSlash+1);
wins_lifetime = data.substring(secondSlash+1).toFloat();
thirdSlash = data.indexOf("/",secondSlash+1);
score_lifetime = data.substring(thirdSlash+1).toFloat();
fourthSlash = data.indexOf("/", thirdSlash+1);
kd_solo = data.substring(fourthSlash+1).toFloat();
fifthSlash = data.indexOf("/", fourthSlash+1);
kills_solo = data.substring(fifthSlash+1).toFloat();
sixthSlash = data.indexOf("/", fifthSlash+1);
wins_solo = data.substring(sixthSlash+1).toFloat();
seventhSlash = data.indexOf("/", sixthSlash+1);
score_solo = data.substring(seventhSlash+1).toFloat();
eighthSlash = data.indexOf("/", seventhSlash+1);
kd_duo = data.substring(eighthSlash+1).toFloat();
ninethSlash = data.indexOf("/", eighthSlash+1);
kills_duo = data.substring(ninethSlash+1).toFloat();
tenthSlash = data.indexOf("/", ninethSlash+1);
wins_duo = data.substring(tenthSlash+1).toFloat();
eleventhSlash = data.indexOf("/", tenthSlash+1);
score_duo = data.substring(eleventhSlash+1).toFloat();
twelvethSlash = data.indexOf("/", eleventhSlash+1);
kd_squad = data.substring(twelvethSlash+1).toFloat();
thirteenthSlash = data.indexOf("/", twelvethSlash+1);
kills_squad = data.substring(thirteenthSlash+1).toFloat();
fourteenthSlash = data.indexOf("/", thirteenthSlash+1);
wins_squad = data.substring(fourteenthSlash+1).toFloat();
fifteenthSlash = data.indexOf("/", fourteenthSlash+1);
score_squad= data.substring(fifteenthSlash+1).toFloat();
tft.fillScreen(ST7735_BLACK);
tft.setTextColor(ST7735_WHITE);
tft.setTextSize(1);
tft.setRotation(3);
tft.drawBitmap(0,0,icon,128,32,ST7735_WHITE);
if (digitalRead(tftButtonA) == LOW) {
state--;
if (state == 0)
state = 4;
}
if (digitalRead(tftButtonB) == LOW) {
state++;
if (state == 5)
state = 1;
}
switch (state) {
case 1:
tft.setCursor(40, 35);
tft.print("LIFETIME");
tft.setCursor(0, 50);
tft.print("K/D: ");
tft.print(kd_lifetime);
tft.setCursor(0, 70);
tft.print("KILLS: ");
tft.print(kills_lifetime, 0);
tft.setCursor(0, 90);
tft.print("WINS: ");
tft.print(wins_lifetime, 0);
tft.setCursor(0, 110);
tft.print("SCORE: ");
tft.print(score_lifetime, 0);
break;
case 2:
tft.setCursor(40, 35);
tft.print("SOLO");
tft.setCursor(0, 50);
tft.print("K/D: ");
tft.print(kd_solo);
tft.setCursor(0, 70);
tft.print("KILLS: ");
tft.print(kills_solo, 0);
tft.setCursor(0, 90);
tft.print("WINS: ");
tft.print(wins_solo, 0);
tft.setCursor(0, 110);
tft.print("SCORE: ");
tft.print(score_solo, 0);
break;
case 3:
tft.setCursor(40, 35);
tft.print("DUO");
tft.setCursor(0, 50);
tft.print("K/D: ");
tft.print(kd_duo);
tft.setCursor(0, 70);
tft.print("KILLS: ");
tft.print(kills_duo, 0);
tft.setCursor(0, 90);
tft.print("WINS: ");
tft.print(wins_duo, 0);
tft.setCursor(0, 110);
tft.print("SCORE: ");
tft.print(score_duo, 0);
break;
case 4:
tft.setCursor(40, 35);
tft.print("SQUAD");
tft.setCursor(0, 50);
tft.print("K/D: ");
tft.print(kd_squad);
tft.setCursor(0, 70);
tft.print("KILLS: ");
tft.print(kills_squad, 0);
tft.setCursor(0, 90);
tft.print("WINS: ");
tft.print(wins_squad, 0);
tft.setCursor(0, 110);
tft.print("SCORE: ");
tft.print(score_squad, 0);
break;
}
delay(1000);
}
Step 13:Insert the LCD Module into the Dot One making sure it is inserted the right orientation and powering it up. Press the left button to download the program into the Dot One.
Step 14: (Optional)Insert the Dot One into the case.
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 try out some of these tutorials:
Comments