Awesome Fortnite Stats Display Using Wia Dot One + LCD

Do you want to display live statistics about your Fortnite character? With this project, you can!

AdvancedFull instructions provided2 hours710
Awesome Fortnite Stats Display Using Wia Dot One + LCD

Things used in this project

Hardware components

Wia Dot One
Wia Dot One
×1
Wia Micro USB Cable
Wia Micro USB Cable
×1
Wia TFT LCD Screen Module
Wia TFT LCD Screen Module
×1

Software apps and online services

Wia
Wia

Hand tools and fabrication machines

3D Printer (generic)
3D Printer (generic)

Story

Read more

Custom parts and enclosures

Enclosure Parts

Code

Code For Project

C/C++
Paste this into the code editor on the Wia Platform
#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, 0xf0, 0xf1, 0xe3, 0xf1, 0xf8, 0xff, 
  0x80, 0x02, 0x08, 0x00, 0xe3, 0xf8, 0x78, 0x71, 0xc7, 0xe3, 0xf0, 0x71, 0xe3, 0xf1, 0xf8, 0xff, 
  0x80, 0x04, 0x04, 0x00, 0xe3, 0xf8, 0xfc, 0x71, 0xc7, 0xe3, 0xf0, 0x31, 0xe3, 0xf1, 0xf8, 0xff, 
  0x80, 0x08, 0x02,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7f, 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);

}

Flow Function Code

JavaScript
Paste this Code into the Flow Function.
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;

Credits

Szymon Masternak

Szymon Masternak

6 projects • 5 followers
Jack Duff

Jack Duff

32 projects • 8 followers
Man of the people. Champion of the downtrodden. Marketing magic @ Wia. Becoming a maker by learning, building, and exploring
Adam O' Ceallaigh

Adam O' Ceallaigh

20 projects • 8 followers
Andrew Berry

Andrew Berry

25 projects • 11 followers
Spivey

Spivey

82 projects • 59 followers
Tourist in a Tutu || US Born || Melbourne/Mexico/California Raised || New Yorker at ❤️ || SF to Dublin to be COO of Wia the best IoT startup

Comments