Crypto ticker with Waveshare 7.5" E-paper on ESP32

Hello,

so I don´t know, how to display this code on my Waveshare 7.5" B/W. Could somebody help me?

#include <WiFi.h>
#include <HTTPClient.h>
#include <WifiClientSecure.h>
#include <ArduinoJson.h>
#include "cryptos.h"
#include "coingecko-api.h"

// ----------------------------
// Configurations - Update these
// ----------------------------

const char *ssid = "SSID";
const char *password = "PASS";
unsigned long secondsForEachCrypto = 5;

void setup()
{
  Serial.begin(115200);

  connectToWifi();

  delay(4000);
}

void loop()
{
  downloadBaseData("czk");
  delay(1000);
  downloadBtcAndEthPrice();
  for (int i = 0; i < cryptosCount; i++)
  {
    renderCryptoCard(cryptos[i]);
    delay(secondsForEachCrypto * 1000);
  }
}

void renderCryptoCard(Crypto crypto)
{

  Serial.print("Crypto Name  - "); Serial.println(crypto.symbol);

  Serial.print("price usd - "); Serial.println(formatCurrency(crypto.price.czk));

  Serial.print("Day change - "); Serial.println(formatPercentageChange(crypto.dayChange));

  Serial.print("Week change - "); Serial.println(formatPercentageChange(crypto.weekChange));
 
  Serial.print("Price in Bitcoin - "); Serial.println(crypto.price.btc);
  
  Serial.print("Price in ETH - "); Serial.println(crypto.price.eth);
 
}



void connectToWifi()
{
  WiFi.begin(ssid, password);
  String dots[3] = {".", "..", "..."};
  int numberOfDots = 1;

  //tft.setTextColor(//tft_WHITE, //tft_BLACK);
  while (WiFi.status() != WL_CONNECTED)
  {
   
    Serial.println("Connecting to WiFi");
    if (numberOfDots == 3)
    {
      numberOfDots = 0;
    }
    else
    {
      numberOfDots++;
    }

    delay(300);
    //tft.fillScreen(//tft_BLACK);
  }

  Serial.println("Connected!!!_______________");

}

String formatCurrency(double price)
{
  int digitsAfterDecimal = 3;

  if (price >= 1000)
  {
    digitsAfterDecimal = 0;
  }
  else if (price >= 100)
  {
    digitsAfterDecimal = 1;
  }
  else if (price >= 1)
  {
    digitsAfterDecimal = 2;
  }
  else if (price < 0.001)
  {
    digitsAfterDecimal = 4;
  }

  return String(price, digitsAfterDecimal);
}

String formatPercentageChange(double change)
{


  double absChange = change;

  if (change < 0)
  {
    absChange = -change;
  }

  if (absChange > 100) {
    return String(absChange, 0) + "%";
  } else if (absChange >= 10) {
    return String(absChange, 1) + "%";
  } else {
    return String(absChange) + "%";
  }
}

ZinggJM/GxEPD2: Arduino Display Library for SPI E-Paper Displays (github.com) is a library that can drive the display thingy.

Thanks. I already tried these libraries. The problem is that I don´t really understand it so I hoped if someone could help with that.

I would have approached the matter with I got a 7.5 inch e display that I am having issues with getting it to work with the GXEPD2 library, here is my best efforts and this is where I am stuck.

Good luck.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.