"Const unsigned char" Problem

I get error. I want to make that showing logo and their value for every crypto. Please help me.

/*******************************************************************
    A project to display crypto currency prices using an ESP8266

    Main Hardware:
    - NodeMCU Development Board (Any ESP8266 dev board will work)
    - OLED I2C Display (SH1106)

    Written by Brian Lough
    https://www.youtube.com/channel/UCezJOfu7OtqGzd5xrP3q6WA
 *******************************************************************/

// ----------------------------
// Standard Libraries - Already Installed if you have ESP8266 set up
// ----------------------------

#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
#include <Wire.h>

// ----------------------------
// Additional Libraries - each one of these will need to be installed.
// ----------------------------

#include <CoinMarketCapApi.h>
// For Integrating with the CoinMarketCap.com API
// Available on the library manager (Search for "CoinMarket")
// https://github.com/witnessmenow/arduino-coinmarketcap-api

#include "SH1106.h"
// The driver for the OLED display
// Available on the library manager (Search for "oled ssd1306")
// https://github.com/squix78/esp8266-oled-ssd1306

#include <ArduinoJson.h>
// !! NOTE !!: When installing this select an older version than V6 from the drop down
// Required by the CoinMarketCapApi Library for parsing the response
// Available on the library manager (Search for "arduino json")
// https://github.com/squix78/esp8266-oled-ssd1306


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

char ssid[] = "WiFiNetworkName";       // your network SSID (name)
char password[] = "password";  // your network key

// Pins based on your wiring
#define SCL_PIN D5
#define SDA_PIN D3
#define upLED 13
#define downLED 12
#define LOGO_GENISLIK 48
#define LOGO_YUKSEKLIK 48
// CoinMarketCap's limit is "no more than 10 per minute"
// Make sure to factor in if you are requesting more than one coin.
// We'll request a new value just before we change the screen so it's the most up to date
unsigned long screenChangeDelay = 10000; // Every 10 seconds

// Have tested up to 10, can probably do more
#define MAX_HOLDINGS 10

#define CURRENCY "eur" //See CoinMarketCap.com for currency options (usd, gbp etc)
#define CURRENCY_SYMBOL "E" // Euro doesn't seem to work, $ and £ do

// You also need to add your crypto currecnies in the setup function

// ----------------------------
// End of area you need to change
// ----------------------------


WiFiClientSecure client;
CoinMarketCapApi api(client);

SH1106 display(0x3c, SDA_PIN, SCL_PIN);

unsigned long screenChangeDue;

struct Holding {
  String tickerId;
  float amount;
  bool inUse;
const unsigned char logo [288];
  CMCTickerResponse lastResponse;
};

Holding holdings[MAX_HOLDINGS];

int currentIndex = -1;
String ipAddressString;

void addNewHolding(String tickerId, const unsigned char logo [288], float amount = 0) {
  int index = getNextFreeHoldingIndex();
  if (index > -1) {
    holdings[index].tickerId = tickerId;
    holdings[index].amount = amount;
    holdings[index].inUse = true;
    holdings[index].logo = logo;
  }
}

void setup() {

  Serial.begin(115200);
  pinMode(upLED, OUTPUT);                                                     //Define the LED pin outputs
  pinMode(downLED, OUTPUT);
  // ----------------------------
  // Holdings - Add your currencies here
  // ----------------------------
  // Go to the currencies coinmarketcap.com page
  // and take the tickerId from the URL (use bitcoin or ethereum as an example)
  
  addNewHolding("bitcoin",  { 0x00, 0x00, 0x0f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff,
      0xc0, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x7f,
      0xff, 0xff, 0xfe, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0x80,
      0x03, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x07, 0xff, 0xfe, 0x3f, 0xff, 0xe0, 0x0f, 0xff, 0xfe, 0x73,
      0xff, 0xf0, 0x0f, 0xff, 0xfc, 0x63, 0xff, 0xf0, 0x1f, 0xff, 0x0c, 0x63, 0xff, 0xf8, 0x1f, 0xff,
      0x00, 0x63, 0xff, 0xfc, 0x3f, 0xff, 0x80, 0x07, 0xff, 0xfc, 0x3f, 0xff, 0xe0, 0x01, 0xff, 0xfc,
      0x7f, 0xff, 0xe0, 0x80, 0x7f, 0xfe, 0x7f, 0xff, 0xe0, 0xf0, 0x3f, 0xfe, 0x7f, 0xff, 0xe1, 0xf8,
      0x3f, 0xfe, 0xff, 0xff, 0xc1, 0xf8, 0x1f, 0xff, 0xff, 0xff, 0xc1, 0xf8, 0x1f, 0xff, 0xff, 0xff,
      0xc1, 0xf8, 0x3f, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x3f, 0xff, 0xff, 0xff, 0x80, 0x00, 0x7f, 0xff,
      0xff, 0xff, 0x82, 0x00, 0xff, 0xff, 0xff, 0xff, 0x83, 0xc0, 0x7f, 0xff, 0xff, 0xff, 0x87, 0xf0,
      0x3f, 0xff, 0xff, 0xff, 0x07, 0xf8, 0x3f, 0xff, 0xff, 0xfb, 0x07, 0xf8, 0x3f, 0xff, 0x7f, 0xf8,
      0x07, 0xf0, 0x3f, 0xfe, 0x7f, 0xf0, 0x03, 0xf0, 0x3f, 0xfe, 0x7f, 0xf8, 0x00, 0x00, 0x7f, 0xfe,
      0x3f, 0xff, 0x80, 0x00, 0x7f, 0xfc, 0x3f, 0xff, 0x88, 0x00, 0xff, 0xfc, 0x3f, 0xff, 0x9c, 0x43,
      0xff, 0xfc, 0x1f, 0xff, 0x18, 0xff, 0xff, 0xf8, 0x0f, 0xff, 0x18, 0xff, 0xff, 0xf8, 0x0f, 0xff,
      0xf8, 0xff, 0xff, 0xf0, 0x07, 0xff, 0xfd, 0xff, 0xff, 0xe0, 0x03, 0xff, 0xff, 0xff, 0xff, 0xc0,
      0x01, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x7f, 0xff, 0xff,
      0xfe, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x07,
      0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xf8, 0x00, 0x00
    });
  addNewHolding("dogecoin",  { 0x00, 0x00, 0x0f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff,
      0xc0, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x7f,
      0xff, 0xff, 0xfe, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0x80,
      0x03, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x07, 0xff, 0xfe, 0x3f, 0xff, 0xe0, 0x0f, 0xff, 0xfe, 0x73,
      0xff, 0xf0, 0x0f, 0xff, 0xfc, 0x63, 0xff, 0xf0, 0x1f, 0xff, 0x0c, 0x63, 0xff, 0xf8, 0x1f, 0xff,
      0x00, 0x63, 0xff, 0xfc, 0x3f, 0xff, 0x80, 0x07, 0xff, 0xfc, 0x3f, 0xff, 0xe0, 0x01, 0xff, 0xfc,
      0x7f, 0xff, 0xe0, 0x80, 0x7f, 0xfe, 0x7f, 0xff, 0xe0, 0xf0, 0x3f, 0xfe, 0x7f, 0xff, 0xe1, 0xf8,
      0x3f, 0xfe, 0xff, 0xff, 0xc1, 0xf8, 0x1f, 0xff, 0xff, 0xff, 0xc1, 0xf8, 0x1f, 0xff, 0xff, 0xff,
      0xc1, 0xf8, 0x3f, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x3f, 0xff, 0xff, 0xff, 0x80, 0x00, 0x7f, 0xff,
      0xff, 0xff, 0x82, 0x00, 0xff, 0xff, 0xff, 0xff, 0x83, 0xc0, 0x7f, 0xff, 0xff, 0xff, 0x87, 0xf0,
      0x3f, 0xff, 0xff, 0xff, 0x07, 0xf8, 0x3f, 0xff, 0xff, 0xfb, 0x07, 0xf8, 0x3f, 0xff, 0x7f, 0xf8,
      0x07, 0xf0, 0x3f, 0xfe, 0x7f, 0xf0, 0x03, 0xf0, 0x3f, 0xfe, 0x7f, 0xf8, 0x00, 0x00, 0x7f, 0xfe,
      0x3f, 0xff, 0x80, 0x00, 0x7f, 0xfc, 0x3f, 0xff, 0x88, 0x00, 0xff, 0xfc, 0x3f, 0xff, 0x9c, 0x43,
      0xff, 0xfc, 0x1f, 0xff, 0x18, 0xff, 0xff, 0xf8, 0x0f, 0xff, 0x18, 0xff, 0xff, 0xf8, 0x0f, 0xff,
      0xf8, 0xff, 0xff, 0xf0, 0x07, 0xff, 0xfd, 0xff, 0xff, 0xe0, 0x03, 0xff, 0xff, 0xff, 0xff, 0xc0,
      0x01, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x7f, 0xff, 0xff,
      0xfe, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x07,
      0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xf8, 0x00, 0x00
    });
  addNewHolding("ethereum",  { 0x00, 0x00, 0x0f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff,
      0xc0, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x7f,
      0xff, 0xff, 0xfe, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0x80,
      0x03, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x07, 0xff, 0xfe, 0x3f, 0xff, 0xe0, 0x0f, 0xff, 0xfe, 0x73,
      0xff, 0xf0, 0x0f, 0xff, 0xfc, 0x63, 0xff, 0xf0, 0x1f, 0xff, 0x0c, 0x63, 0xff, 0xf8, 0x1f, 0xff,
      0x00, 0x63, 0xff, 0xfc, 0x3f, 0xff, 0x80, 0x07, 0xff, 0xfc, 0x3f, 0xff, 0xe0, 0x01, 0xff, 0xfc,
      0x7f, 0xff, 0xe0, 0x80, 0x7f, 0xfe, 0x7f, 0xff, 0xe0, 0xf0, 0x3f, 0xfe, 0x7f, 0xff, 0xe1, 0xf8,
      0x3f, 0xfe, 0xff, 0xff, 0xc1, 0xf8, 0x1f, 0xff, 0xff, 0xff, 0xc1, 0xf8, 0x1f, 0xff, 0xff, 0xff,
      0xc1, 0xf8, 0x3f, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x3f, 0xff, 0xff, 0xff, 0x80, 0x00, 0x7f, 0xff,
      0xff, 0xff, 0x82, 0x00, 0xff, 0xff, 0xff, 0xff, 0x83, 0xc0, 0x7f, 0xff, 0xff, 0xff, 0x87, 0xf0,
      0x3f, 0xff, 0xff, 0xff, 0x07, 0xf8, 0x3f, 0xff, 0xff, 0xfb, 0x07, 0xf8, 0x3f, 0xff, 0x7f, 0xf8,
      0x07, 0xf0, 0x3f, 0xfe, 0x7f, 0xf0, 0x03, 0xf0, 0x3f, 0xfe, 0x7f, 0xf8, 0x00, 0x00, 0x7f, 0xfe,
      0x3f, 0xff, 0x80, 0x00, 0x7f, 0xfc, 0x3f, 0xff, 0x88, 0x00, 0xff, 0xfc, 0x3f, 0xff, 0x9c, 0x43,
      0xff, 0xfc, 0x1f, 0xff, 0x18, 0xff, 0xff, 0xf8, 0x0f, 0xff, 0x18, 0xff, 0xff, 0xf8, 0x0f, 0xff,
      0xf8, 0xff, 0xff, 0xf0, 0x07, 0xff, 0xfd, 0xff, 0xff, 0xe0, 0x03, 0xff, 0xff, 0xff, 0xff, 0xc0,
      0x01, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x7f, 0xff, 0xff,
      0xfe, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x07,
      0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xf8, 0x00, 0x00
    });

  // ----------------------------
  // Everything below can be thinkered with if you want but should work as is!
  // ----------------------------

  // Initialising the display
  display.init();
  display.setTextAlignment(TEXT_ALIGN_CENTER);
  display.setFont(ArialMT_Plain_16);
  display.drawString(64, 0, F("HODL Display"));
  display.setFont(ArialMT_Plain_10);
  display.drawString(64, 18, F("By Brian Lough"));
  display.display();
  

  // Set WiFi to station mode and disconnect from an AP if it was Previously
  // connected
  WiFi.mode(WIFI_STA);
  WiFi.disconnect();
  delay(100);

  // Attempt to connect to Wifi network:
  Serial.print("Connecting Wifi: ");
  Serial.println(ssid);
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    Serial.print(".");
    delay(500);
  }
  Serial.println("");
  Serial.println("WiFi connected");
  Serial.println("IP address: ");
  IPAddress ip = WiFi.localIP();
  Serial.println(ip);
  ipAddressString = ip.toString();
}

int getNextFreeHoldingIndex() {
  for (int i = 0; i < MAX_HOLDINGS; i++) {
    if (!holdings[i].inUse) {
      return i;
    }
  }

  return -1;
}

int getNextIndex() {
  for (int i = currentIndex + 1; i < MAX_HOLDINGS; i++) {
    if (holdings[i].inUse) {
      return i;
    }
  }

  for (int j = 0; j <= currentIndex; j++) {
    if (holdings[j].inUse) {
      return j;
    }
  }

  return -1;
}

void displayHolding(int index) {

  CMCTickerResponse response = holdings[index].lastResponse;

  display.clear();

  display.setTextAlignment(TEXT_ALIGN_CENTER);
  display.setFont(ArialMT_Plain_16);
  display.drawString(64, 0, response.symbol);
  display.setFont(ArialMT_Plain_24);
  double price = response.price_currency;
  if (price == 0) {
    price = response.price_usd;
  }
  display.drawString(64, 20, formatCurrency(price));
  display.setFont(ArialMT_Plain_16);
//  display.setTextAlignment(TEXT_ALIGN_CENTER);
//  display.drawString(64, 48, " 1h:" + String(response.percent_change_1h) + "%");
    logoCizdir(logo);
  display.setTextAlignment(TEXT_ALIGN_CENTER);
  display.drawString(64, 48, "24h: " + String(response.percent_change_24h) + "%");

  display.display();
  if (response.percent_change_24h > 0)                                                                         //If price has increased from yesterday
  {
    digitalWrite(upLED, HIGH);
    digitalWrite(downLED, LOW);
  } 
  else                                                                                  //If price has decreased from yesterday
  {
    digitalWrite(downLED, HIGH);
    digitalWrite(upLED, LOW);
  }
}
void logoCizdir(const unsigned char logo []) {
  display.drawBitmap(0,
                     (display.height() + (display.height() / 4) - LOGO_YUKSEKLIK) / 2,
                     logo, LOGO_GENISLIK, LOGO_YUKSEKLIK, 1);
  display.display();
}
void displayMessage(String message){
  display.clear();
  display.setFont(ArialMT_Plain_10);
  display.setTextAlignment(TEXT_ALIGN_LEFT);
  display.drawStringMaxWidth(0, 0, 128, message);
  display.display();
}

String formatCurrency(float price) {
  String formattedCurrency = CURRENCY_SYMBOL;
  int pointsAfterDecimal = 6;
  if (price > 100) {
    pointsAfterDecimal = 2;
  } else if (price > 1) {
    pointsAfterDecimal = 4;
  }
  formattedCurrency.concat(String(price, pointsAfterDecimal));
  return formattedCurrency;
}

bool loadDataForHolding(int index) {
  int nextIndex = getNextIndex();
  if (nextIndex > -1 ) {
    holdings[index].lastResponse = api.GetTickerInfo(holdings[index].tickerId, CURRENCY);
    return holdings[index].lastResponse.error == "";
  }

  return false;
}

void loop() {

  unsigned long timeNow = millis();
  if ((timeNow > screenChangeDue))  {
    currentIndex = getNextIndex();
    if (currentIndex > -1) {
      if (loadDataForHolding(currentIndex)) {
        displayHolding(currentIndex);
      } else {
        displayMessage(F("Error loading data."));
      }
    } else {
      displayMessage(F("No funds to display. Edit the setup to add them"));
    }
    screenChangeDue = timeNow + screenChangeDelay;
  }
}

My Fault Code:

SimpleCrypto:88:30: error: use of deleted function 'Holding::Holding()'
   88 | Holding holdings[MAX_HOLDINGS];
      |                              ^
D:\COD\BitcoinTicker\Den - Kopya\simple-arduino-crypto-display-master\simple-arduino-crypto-display-master\SimpleCrypto\SimpleCrypto.ino:80:8: note: 'Holding::Holding()' is implicitly deleted because the default definition would be ill-formed:
   80 | struct Holding {
      |        ^~~~~~~
SimpleCrypto:80:8: error: uninitialized const member in 'struct Holding'
D:\COD\BitcoinTicker\Den - Kopya\simple-arduino-crypto-display-master\simple-arduino-crypto-display-master\SimpleCrypto\SimpleCrypto.ino:84:21: note: 'const unsigned char Holding::logo [288]' should be initialized
   84 | const unsigned char logo [288];
      |                     ^~~~
D:\COD\BitcoinTicker\Den - Kopya\simple-arduino-crypto-display-master\simple-arduino-crypto-display-master\SimpleCrypto\SimpleCrypto.ino: In function 'void addNewHolding(String, const unsigned char*, float)':
SimpleCrypto:99:26: error: assignment of read-only member 'Holding::logo'
   99 |     holdings[index].logo = logo;
      |     ~~~~~~~~~~~~~~~~~~~~~^~~~~~
D:\COD\BitcoinTicker\Den - Kopya\simple-arduino-crypto-display-master\simple-arduino-crypto-display-master\SimpleCrypto\SimpleCrypto.ino: In function 'void setup()':
SimpleCrypto:132:6: error: cannot convert '<brace-enclosed initializer list>' to 'const unsigned char*'
  132 |     });
      |      ^
      |      |
      |      <brace-enclosed initializer list>
D:\COD\BitcoinTicker\Den - Kopya\simple-arduino-crypto-display-master\simple-arduino-crypto-display-master\SimpleCrypto\SimpleCrypto.ino:93:57: note:   initializing argument 2 of 'void addNewHolding(String, const unsigned char*, float)'
   93 | void addNewHolding(String tickerId, const unsigned char logo [288], float amount = 0) {
      |                                     ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
SimpleCrypto:151:6: error: cannot convert '<brace-enclosed initializer list>' to 'const unsigned char*'
  151 |     });
      |      ^
      |      |
      |      <brace-enclosed initializer list>
D:\COD\BitcoinTicker\Den - Kopya\simple-arduino-crypto-display-master\simple-arduino-crypto-display-master\SimpleCrypto\SimpleCrypto.ino:93:57: note:   initializing argument 2 of 'void addNewHolding(String, const unsigned char*, float)'
   93 | void addNewHolding(String tickerId, const unsigned char logo [288], float amount = 0) {
      |                                     ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
SimpleCrypto:170:6: error: cannot convert '<brace-enclosed initializer list>' to 'const unsigned char*'
  170 |     });
      |      ^
      |      |
      |      <brace-enclosed initializer list>
D:\COD\BitcoinTicker\Den - Kopya\simple-arduino-crypto-display-master\simple-arduino-crypto-display-master\SimpleCrypto\SimpleCrypto.ino:93:57: note:   initializing argument 2 of 'void addNewHolding(String, const unsigned char*, float)'
   93 | void addNewHolding(String tickerId, const unsigned char logo [288], float amount = 0) {
      |                                     ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
D:\COD\BitcoinTicker\Den - Kopya\simple-arduino-crypto-display-master\simple-arduino-crypto-display-master\SimpleCrypto\SimpleCrypto.ino: In function 'void displayHolding(int)':
SimpleCrypto:252:16: error: 'logo' was not declared in this scope; did you mean 'logl'?
  252 |     logoCizdir(logo);
      |                ^~~~
      |                logl
D:\COD\BitcoinTicker\Den - Kopya\simple-arduino-crypto-display-master\simple-arduino-crypto-display-master\SimpleCrypto\SimpleCrypto.ino: In function 'void logoCizdir(const unsigned char*)':
SimpleCrypto:269:11: error: 'SH1106' {aka 'class SH1106Wire'} has no member named 'drawBitmap'
  269 |   display.drawBitmap(0,
      |           ^~~~~~~~~~
exit status 1
use of deleted function 'Holding::Holding()'

don't declare it const if you want to modify it later on.... :slight_smile:

you can't assign an array this way holdings[index].logo = logo;. You have to copy each value into the destination or use memcpy()

2 Likes

Bro my LEDs didn't work why? when I tested with an external supply, they worked.

//mucitpilot kripto para takip uygulamas─▒
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
#include <WiFiClientSecureBearSSL.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <ArduinoJson.h> //5 nolu s├╝r├╝m├╝ y├╝kleyin 6 ile ├žal─▒┼čmaz

// A─č ad─▒ ve ┼čifresini girin
#define WIFI_SSID "ATA CUMHURIYETI"
#define WIFI_PASS "19982002"

// setup zaman─▒ (sn)
#define SETUP_TIME 4

// Ekran yenileme zaman─▒ (sn)
#define UPDATE_TIME 5

// Kripto para i├žin kullan─▒lacak para birimi: eur / usd / gbp olabilir.
#define CURRENCY_CODE "usd"
// para birimi veya sembol, tested: harfler veya $ i┼čareti olabilir.
#define CURRENCY_SYM '$'
#define upLED 12
#define downLED 13
#define blue 15
//Https yani g├╝venli ba─člant─▒ i├žin sitelere ait gerekli parmak izi bilgileri
//bir sitenin fingerprintini bulmak i├žin https://www.grc.com/fingerprints.htm  adresini kullanabiliriz.
// Fingerprint ---> api.cryptonator.com - 6 ┼×ubat 2022'ye kadar ge├žerli
const uint8_t fingerprint_crypto[20] = {0x10, 0x76, 0x19, 0x6B, 0xE9, 0xE5, 0x87, 0x5A, 0x26, 0x12, 0x15, 0xDE, 0x9F, 0x7D, 0x3B, 0x92, 0x9A, 0x7F, 0x30, 0x13};

// OLED Ekran tan─▒mlamalar─▒
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define OLED_RESET -1
#define SCREEN_ADDRESS 0x3C
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);

// Coin'lere ait logolar─▒n ebat─▒ 48x48 piksel olmal─▒
//http://javl.github.io/image2cpp/ sitesini kullanarak monokrom bitmap'leriniz i├žin gerekli kodu ├╝retebilirsiniz.
#define LOGO_GENISLIK 48
#define LOGO_YUKSEKLIK 48

// Coinlerimize ait bilgileri saklamak i├žin bir veri tipi blo─ču olu┼čturuyoruz.
struct asset {
  String assetName;
  String url;
  const unsigned char logo [288];
};

// Kullanaca─č─▒m─▒z t├╝m coin'ler i├žin bilgileri olu┼čturmam─▒z gerekli
// Yeni bir COIN eklemek isterseniz:
//  1: A┼ča─č─▒daki ├Ârneklerden birini kopyalay─▒p yap─▒┼čt─▒r─▒n
//  2: Kripto ismini g├╝ncelleyin
//  3: api.cryptonator.com sitesinden o coin i├žin gerekli linki al─▒n
//  4: http://javl.github.io/image2cpp/ sitesini kullanarak o coin i├žin 48x48'lik bir simge ol┼čturun
asset assets[] = {
  // Doge coin bilgileri
  { "Doge",
    "https://api.cryptonator.com/api/ticker/doge-" + String(CURRENCY_CODE),
    { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00,
      0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x07, 0x00, 0x00, 0x01, 0xa0, 0x00, 0x0f, 0x00, 0x00, 0x01,
      0x80, 0x00, 0x1f, 0x00, 0x00, 0x01, 0x98, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x80, 0x00, 0x7e, 0x00,
      0x00, 0x01, 0x83, 0xe1, 0xf8, 0x00, 0x00, 0x01, 0x83, 0xe1, 0xf8, 0x00, 0x00, 0x01, 0x3f, 0xfd,
      0xd8, 0x00, 0x00, 0x07, 0xff, 0xfe, 0x10, 0x00, 0x00, 0x1f, 0xe7, 0xff, 0x90, 0x00, 0x00, 0x7f,
      0xe7, 0xff, 0x80, 0x00, 0x01, 0xff, 0xdf, 0xff, 0xf0, 0x00, 0x03, 0xff, 0xdf, 0xff, 0xff, 0x00,
      0x03, 0xff, 0xdf, 0xff, 0xff, 0x80, 0x07, 0xc7, 0xff, 0xff, 0xff, 0xc0, 0x07, 0xc7, 0xff, 0xff,
      0xff, 0xc0, 0x07, 0xe7, 0xff, 0xff, 0xff, 0xc0, 0x0f, 0xcf, 0xfd, 0x1f, 0xff, 0xc0, 0x0f, 0xff,
      0xfe, 0x0f, 0xff, 0xe0, 0x0f, 0xff, 0xfa, 0x1f, 0xff, 0xe0, 0x1f, 0xff, 0xfe, 0x7f, 0xff, 0xe0,
      0x1f, 0xdf, 0xff, 0xff, 0xff, 0xe0, 0x1e, 0x07, 0xff, 0xff, 0xff, 0xe0, 0x1e, 0x01, 0xff, 0xff,
      0xff, 0xe0, 0x1e, 0x01, 0xff, 0xff, 0xff, 0xe0, 0x1e, 0x01, 0xff, 0xff, 0xff, 0xe0, 0x1e, 0x0f,
      0xff, 0xff, 0xff, 0xe0, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xe0,
      0x0f, 0x9f, 0xff, 0xff, 0xff, 0xe0, 0x0e, 0x07, 0xff, 0xff, 0xff, 0xe0, 0x0f, 0xc0, 0x1f, 0xff,
      0xff, 0xc0, 0x0f, 0xc0, 0x1f, 0xff, 0xff, 0xc0, 0x07, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x07, 0xff,
      0xff, 0xff, 0xff, 0x80, 0x03, 0xff, 0xff, 0xff, 0xff, 0x80, 0x01, 0xff, 0xff, 0xff, 0xff, 0x00,
      0x01, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x1f, 0xff, 0xff,
      0xf0, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x01,
      0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x3f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
    }
  },
  // BTC ayarlar─▒
  { "BTC",
    "https://api.cryptonator.com/api/ticker/btc-" + String(CURRENCY_CODE),
    { 0x00, 0x00, 0x0f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff,
      0xc0, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x7f,
      0xff, 0xff, 0xfe, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0x80,
      0x03, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x07, 0xff, 0xfe, 0x3f, 0xff, 0xe0, 0x0f, 0xff, 0xfe, 0x73,
      0xff, 0xf0, 0x0f, 0xff, 0xfc, 0x63, 0xff, 0xf0, 0x1f, 0xff, 0x0c, 0x63, 0xff, 0xf8, 0x1f, 0xff,
      0x00, 0x63, 0xff, 0xfc, 0x3f, 0xff, 0x80, 0x07, 0xff, 0xfc, 0x3f, 0xff, 0xe0, 0x01, 0xff, 0xfc,
      0x7f, 0xff, 0xe0, 0x80, 0x7f, 0xfe, 0x7f, 0xff, 0xe0, 0xf0, 0x3f, 0xfe, 0x7f, 0xff, 0xe1, 0xf8,
      0x3f, 0xfe, 0xff, 0xff, 0xc1, 0xf8, 0x1f, 0xff, 0xff, 0xff, 0xc1, 0xf8, 0x1f, 0xff, 0xff, 0xff,
      0xc1, 0xf8, 0x3f, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x3f, 0xff, 0xff, 0xff, 0x80, 0x00, 0x7f, 0xff,
      0xff, 0xff, 0x82, 0x00, 0xff, 0xff, 0xff, 0xff, 0x83, 0xc0, 0x7f, 0xff, 0xff, 0xff, 0x87, 0xf0,
      0x3f, 0xff, 0xff, 0xff, 0x07, 0xf8, 0x3f, 0xff, 0xff, 0xfb, 0x07, 0xf8, 0x3f, 0xff, 0x7f, 0xf8,
      0x07, 0xf0, 0x3f, 0xfe, 0x7f, 0xf0, 0x03, 0xf0, 0x3f, 0xfe, 0x7f, 0xf8, 0x00, 0x00, 0x7f, 0xfe,
      0x3f, 0xff, 0x80, 0x00, 0x7f, 0xfc, 0x3f, 0xff, 0x88, 0x00, 0xff, 0xfc, 0x3f, 0xff, 0x9c, 0x43,
      0xff, 0xfc, 0x1f, 0xff, 0x18, 0xff, 0xff, 0xf8, 0x0f, 0xff, 0x18, 0xff, 0xff, 0xf8, 0x0f, 0xff,
      0xf8, 0xff, 0xff, 0xf0, 0x07, 0xff, 0xfd, 0xff, 0xff, 0xe0, 0x03, 0xff, 0xff, 0xff, 0xff, 0xc0,
      0x01, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x7f, 0xff, 0xff,
      0xfe, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x07,
      0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xf8, 0x00, 0x00
    }
  },
  // ETH ayarlar─▒
  { "ETH",
    "https://api.cryptonator.com/api/ticker/eth-" + String(CURRENCY_CODE),
    { 0x00, 0x00, 0x07, 0xf0, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff,
      0xc0, 0x00, 0x00, 0x0f, 0xfe, 0xff, 0xf0, 0x00, 0x00, 0x1f, 0xfc, 0x7f, 0xfc, 0x00, 0x00, 0x7f,
      0xfc, 0x7f, 0xfe, 0x00, 0x00, 0xff, 0xf8, 0x3f, 0xff, 0x00, 0x01, 0xff, 0xf0, 0x1f, 0xff, 0x80,
      0x03, 0xff, 0xf0, 0x1f, 0xff, 0xc0, 0x07, 0xff, 0xe0, 0x0f, 0xff, 0xe0, 0x07, 0xff, 0xe0, 0x07,
      0xff, 0xf0, 0x0f, 0xff, 0xc0, 0x07, 0xff, 0xf0, 0x1f, 0xff, 0x80, 0x03, 0xff, 0xf8, 0x1f, 0xff,
      0x80, 0x03, 0xff, 0xf8, 0x3f, 0xff, 0x00, 0x01, 0xff, 0xfc, 0x3f, 0xff, 0x00, 0x00, 0xff, 0xfc,
      0x7f, 0xfe, 0x00, 0x00, 0xff, 0xfe, 0x7f, 0xfc, 0x00, 0x00, 0x7f, 0xfe, 0x7f, 0xfc, 0x00, 0x00,
      0x7f, 0xfe, 0x7f, 0xf8, 0x00, 0x00, 0x3f, 0xfe, 0xff, 0xf8, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xf0,
      0x00, 0x00, 0x1f, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x0f, 0xff,
      0xff, 0xe0, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xfe, 0x00, 0x00,
      0x7f, 0xff, 0x7f, 0xe7, 0x00, 0x01, 0xcf, 0xff, 0x7f, 0xf3, 0xc0, 0x07, 0x9f, 0xff, 0x7f, 0xf8,
      0xf0, 0x0e, 0x3f, 0xfe, 0x7f, 0xf8, 0x38, 0x3c, 0x3f, 0xfe, 0x7f, 0xfc, 0x1e, 0xf0, 0x7f, 0xfe,
      0x3f, 0xfe, 0x07, 0xc0, 0xff, 0xfe, 0x3f, 0xff, 0x03, 0x80, 0xff, 0xfc, 0x1f, 0xff, 0x00, 0x01,
      0xff, 0xfc, 0x1f, 0xff, 0x80, 0x03, 0xff, 0xf8, 0x0f, 0xff, 0xc0, 0x07, 0xff, 0xf0, 0x0f, 0xff,
      0xc0, 0x07, 0xff, 0xf0, 0x07, 0xff, 0xe0, 0x0f, 0xff, 0xe0, 0x03, 0xff, 0xf0, 0x1f, 0xff, 0xc0,
      0x01, 0xff, 0xf0, 0x1f, 0xff, 0xc0, 0x00, 0xff, 0xf8, 0x3f, 0xff, 0x00, 0x00, 0x7f, 0xfc, 0x7f,
      0xfe, 0x00, 0x00, 0x3f, 0xfe, 0x7f, 0xfc, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x07,
      0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x1f, 0xf0, 0x00, 0x00
    }
  },
  // XLM ayarlar─▒
  { "Stellar",
    "https://api.cryptonator.com/api/ticker/xlm-" + String(CURRENCY_CODE),
    { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
      0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00,
      0xff, 0xff, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xc0, 0x03, 0x00, 0x0f, 0xfc, 0x3f, 0xf0, 0x0f,
      0x00, 0x1f, 0xc0, 0x03, 0xc0, 0x3f, 0x00, 0x3f, 0x00, 0x00, 0x00, 0xff, 0x00, 0x7c, 0x00, 0x00,
      0x03, 0xfc, 0x00, 0xf8, 0x00, 0x00, 0x0f, 0xf0, 0x01, 0xf0, 0x00, 0x00, 0x3f, 0xe0, 0x01, 0xe0,
      0x00, 0x00, 0xff, 0x80, 0x03, 0xc0, 0x00, 0x03, 0xfe, 0x01, 0x03, 0xc0, 0x00, 0x07, 0xf8, 0x07,
      0x07, 0x80, 0x00, 0x3f, 0xe0, 0x1f, 0x07, 0x80, 0x00, 0x7f, 0x80, 0x7f, 0x0f, 0x00, 0x01, 0xfe,
      0x01, 0xfe, 0x0f, 0x00, 0x07, 0xf8, 0x07, 0xf8, 0x0f, 0x00, 0x1f, 0xe0, 0x1f, 0xf8, 0x0f, 0x00,
      0x7f, 0x80, 0x7f, 0xf0, 0x0e, 0x01, 0xfe, 0x01, 0xfe, 0x70, 0x0e, 0x07, 0xf8, 0x07, 0xf8, 0x70,
      0x0e, 0x1f, 0xe0, 0x1f, 0xe0, 0x70, 0x0e, 0x7f, 0x80, 0x7f, 0x80, 0x70, 0x0f, 0xfe, 0x01, 0xfe,
      0x00, 0xf0, 0x1f, 0xf8, 0x07, 0xf8, 0x00, 0xf0, 0x1f, 0xe0, 0x1f, 0xe0, 0x00, 0xf0, 0x7f, 0x80,
      0x7f, 0x80, 0x00, 0xf0, 0xfe, 0x01, 0xfe, 0x00, 0x01, 0xe0, 0xf8, 0x07, 0xfc, 0x00, 0x01, 0xe0,
      0xe0, 0x1f, 0xe0, 0x00, 0x03, 0xc0, 0x80, 0x7f, 0xc0, 0x00, 0x03, 0xc0, 0x01, 0xff, 0x00, 0x00,
      0x07, 0x80, 0x07, 0xfc, 0x00, 0x00, 0x0f, 0x80, 0x0f, 0xf0, 0x00, 0x00, 0x1f, 0x00, 0x3f, 0xc0,
      0x00, 0x00, 0x3e, 0x00, 0xff, 0x00, 0x00, 0x00, 0xfc, 0x00, 0xfc, 0x03, 0xc0, 0x03, 0xf8, 0x00,
      0xf0, 0x0f, 0xfc, 0x3f, 0xf0, 0x00, 0xc0, 0x03, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0xff, 0xff,
      0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x00, 0x00,
      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
    }
  },
  // ADA ayarlar─▒
  { "Cardano",
    "https://api.cryptonator.com/api/ticker/ada-" + String(CURRENCY_CODE),
    { 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
      0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
      0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x07, 0x03, 0x81, 0xc0, 0x00,
      0x00, 0x07, 0x03, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
      0x00, 0x00, 0x00, 0x00, 0x30, 0x08, 0x00, 0x00, 0x0c, 0x00, 0xfc, 0x3e, 0x00, 0x60, 0x0c, 0x00,
      0xfc, 0x7f, 0x00, 0x20, 0x00, 0x31, 0xfe, 0x7f, 0x08, 0x00, 0x00, 0x79, 0xfe, 0x7f, 0x1c, 0x00,
      0x00, 0x79, 0xfe, 0x7f, 0x1c, 0x00, 0x00, 0x30, 0xfc, 0x7f, 0x1c, 0x00, 0x00, 0x00, 0x78, 0x3e,
      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x1f,
      0x80, 0x03, 0xf0, 0x00, 0x00, 0x1f, 0xc0, 0x03, 0xf8, 0x60, 0x46, 0x1f, 0xc0, 0x03, 0xf8, 0xe2,
      0xce, 0x1f, 0xc0, 0x03, 0xf8, 0x62, 0x04, 0x1f, 0xc0, 0x03, 0xf8, 0x00, 0x00, 0x0f, 0x80, 0x03,
      0xf0, 0x00, 0x00, 0x07, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
      0x7c, 0x3e, 0x00, 0x00, 0x00, 0x30, 0xfc, 0x7f, 0x1c, 0x00, 0x00, 0x79, 0xfe, 0x7f, 0x1c, 0x00,
      0x00, 0x71, 0xfe, 0x7f, 0x1c, 0x00, 0x00, 0x01, 0xfe, 0x7f, 0x00, 0x00, 0x0c, 0x00, 0xfc, 0x7f,
      0x00, 0x60, 0x0c, 0x00, 0x7c, 0x3e, 0x00, 0x60, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00, 0x03, 0x03, 0xc0, 0xc0, 0x00,
      0x00, 0x03, 0x03, 0x80, 0xc0, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
      0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
    }
  }


};

// Y├╝kseli┼č / D├╝┼č├╝┼č Trend Oklar─▒ 45x26piksel
#define OK_GENISLIK 45
#define OK_YUKSEKLIK 26

// Bitmap olarak Y├╝kseli┼č Oku
const unsigned char stonks [] PROGMEM = {
  0x00, 0x00, 0x00, 0x07, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x03, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x01,
  0xff, 0xf8, 0x00, 0x00, 0x00, 0x00, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00,
  0x00, 0x00, 0x3f, 0xf8, 0x00, 0x03, 0x00, 0x00, 0x1f, 0xf8, 0x00, 0x03, 0x80, 0x00, 0x3f, 0xf8,
  0x00, 0x07, 0xc0, 0x00, 0x7f, 0xf8, 0x00, 0x0f, 0xe0, 0x00, 0xff, 0xf8, 0x00, 0x1f, 0xf0, 0x01,
  0xfd, 0xf8, 0x00, 0x1f, 0xf8, 0x03, 0xf8, 0xf8, 0x00, 0x3f, 0xfc, 0x07, 0xf0, 0x78, 0x00, 0x7c,
  0xfe, 0x0f, 0xf0, 0x38, 0x00, 0xf8, 0xff, 0x1f, 0xe0, 0x18, 0x00, 0xf0, 0x7f, 0xbf, 0xc0, 0x08,
  0x01, 0xe0, 0x3f, 0xff, 0x80, 0x00, 0x03, 0xc0, 0x1f, 0xff, 0x00, 0x00, 0x07, 0x00, 0x0f, 0xfe,
  0x00, 0x00, 0x06, 0x00, 0x07, 0xfc, 0x00, 0x00, 0x0c, 0x00, 0x03, 0xf8, 0x00, 0x00, 0x18, 0x00,
  0x01, 0xf0, 0x00, 0x00, 0x30, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x20, 0x00, 0x00, 0x40, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

// Bitmap olarak D├╝┼č├╝┼č Oku
const unsigned char notstonks [] PROGMEM = {
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
  0x00, 0x20, 0x00, 0x00, 0x38, 0x00, 0x00, 0x60, 0x00, 0x00, 0x7c, 0x00, 0x00, 0xc0, 0x00, 0x00,
  0xfe, 0x00, 0x01, 0x80, 0x00, 0x01, 0xff, 0x00, 0x03, 0x00, 0x00, 0x03, 0xff, 0x80, 0x07, 0x00,
  0x00, 0x07, 0xff, 0xc0, 0x1e, 0x00, 0x00, 0x0f, 0xff, 0xe0, 0x3c, 0x00, 0x80, 0x1f, 0xef, 0xf0,
  0x78, 0x00, 0xc0, 0x3f, 0xc7, 0xf8, 0xf8, 0x00, 0xe0, 0x7f, 0x83, 0xf9, 0xf0, 0x00, 0xf0, 0x7f,
  0x01, 0xff, 0xe0, 0x00, 0xf8, 0xfe, 0x00, 0xff, 0xc0, 0x00, 0xfd, 0xfc, 0x00, 0x7f, 0xc0, 0x00,
  0xff, 0xf8, 0x00, 0x3f, 0x80, 0x00, 0xff, 0xf0, 0x00, 0x1f, 0x00, 0x00, 0xff, 0xe0, 0x00, 0x0e,
  0x00, 0x00, 0xff, 0xc0, 0x00, 0x06, 0x00, 0x00, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0xff, 0xf0,
  0x00, 0x00, 0x00, 0x00, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x00, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00,
  0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00
};

// Hangi coin'in g├Âsterilece─čini tutaca─č─▒m─▒z de─či┼čken
int currentAsset = 0; //dizinin ka├ž─▒nc─▒ eleman─▒
// Dizide ka├ž tane eleman oldu─ču bilgisini tutacak de─či┼čken
const int maxAssets = sizeof(assets) / sizeof(assets[0]);

void setup() {

  Serial.begin(115200);
pinMode(upLED, OUTPUT);                                                     //Define the LED pin outputs
pinMode(downLED, OUTPUT);
pinMode(blue, OUTPUT);
  // OLED ekran─▒ ba┼člat─▒yoruz ve herhangi bir hata varsa uyar─▒yoruz
  if (!display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS)) {
    Serial.println(F("HATA: OLED ekran ba┼člat─▒lamad─▒"));
    while (1); //s├╝rekli burada d├Âner koda devam etmez
  }

  // ├ľnce ekran─▒ temizliyoruz
  display.clearDisplay();
  // Metin rengini beyaz yap─▒yoruz ki arka plan koyu yaz─▒lar a├ž─▒k renk olsun
  display.setTextColor(SSD1306_WHITE);
  // Ba─člant─▒ mesaj─▒ i├žin text boyutunu en k├╝├ž├╝─če ayarlad─▒k
  display.setTextSize(1);

  // Wifi'ye ba─član─▒rken gereken zaman i├žin bekletiyoruz
  for (uint8_t t = SETUP_TIME; t > 0; t--) {
    // Ba─članma durumunu serial'a yazd─▒ral─▒m
    Serial.printf("[SETUP] Bekleyin %d...\n", t);
    Serial.flush();
    // OLED ekrana da yazd─▒ral─▒m
    display.clearDisplay();
    display.setCursor(0, display.height() / 4);
    display.print(F("Basliyor bekleyin . . . "));
    display.print(t);
    display.display();
    delay(1000);
  }

  // Kodun geri kalan k─▒sm─▒ i├žin font boyutunu 2 olarak kullanal─▒m
  display.setTextSize(2);

  // A─ča ba─članal─▒m
  WiFi.mode(WIFI_STA);
  WiFi.begin(WIFI_SSID, WIFI_PASS);
}

void loop() {
  // A─ča ba─član─▒lana kadar bekliyoruz
  if ((WiFi.status() == WL_CONNECTED)) {

    // fingerprinti ayarl─▒yoruz
    uint8_t fingerprint[20];
    // C dilinde bir dizi di─čer diziye memcopy ile atanabilir.
    memcpy(fingerprint, fingerprint_crypto, 20);

    // Bir Https istemcisi ba┼člatal─▒m //bu k─▒s─▒m olmadan SSL sertifikal─▒ sitelerden veri ├žekemeyiz.
    std::unique_ptr<BearSSL::WiFiClientSecure>client(new BearSSL::WiFiClientSecure);
    client->setFingerprint(fingerprint);
    HTTPClient https;

    // API'ya ba─člant─▒ kural─▒m
    Serial.print("HTTPS ba┼člat─▒l─▒yor...\n");
    if (https.begin(*client, assets[currentAsset].url)) {  // HTTPS

      // Ba─člant─▒y─▒ ba┼člatal─▒m ve GET header'─▒n─▒ g├Ânderelim.
      Serial.print("HTTPS GET...\n");
      int httpCode = https.GET();

      // bir hata olmu┼čsa httpCode de─čeri negatif d├Ânecektir.
      if (httpCode > 0) {
        // Sunucudan gelen cevab─▒ i┼člemeliyiz.
        Serial.printf("HTTPS GET... code: %d\n", httpCode);

        // HTTP ileti┼či ge├žerli ise gelen veriyi al─▒p i┼čleyelim
        if (httpCode == HTTP_CODE_OK || httpCode == HTTP_CODE_MOVED_PERMANENTLY) {
          // API'den ald─▒─č─▒m─▒z veri blo─čunu bir String'e at─▒yoruz.
          String payload = https.getString();
          // Coin'in de─čerini, de─čer de─či┼čimini al─▒yor ve bunlardan da %de─či┼čimi hesapl─▒yoruz
          float price;
          float change;
          String nick = "";

          Serial.println("G├╝ncel veriler al─▒nd─▒");
          const size_t capacity = JSON_OBJECT_SIZE(4) + JSON_OBJECT_SIZE(5) + 150;
          DynamicJsonBuffer jsonBuffer(capacity);
          JsonObject& root = jsonBuffer.parseObject(payload);

          if (!root.success()) {
            Serial.println(F("Parsing ba┼čar─▒s─▒z!"));
            return;
          }

          Serial.println(F("Cevap:"));
          Serial.println(root["ticker"]["price"].as<char*>());
          price = root["ticker"]["price"];
          nick = root["ticker"]["base"].as<char*>();
          change = root["ticker"]["change"];

          //price = payload.substring(payload.indexOf("price") + 8, payload.indexOf("volume") - 3).toFloat();
          //change = payload.substring(payload.indexOf("change") + 9, payload.indexOf("timestamp") - 4).toFloat();
          //nick = payload.substring(payload.indexOf("base") + 7, payload.indexOf("target") - 3);

          float changePercent = change / price * 100;

          // Ald─▒─č─▒m─▒z veri blo─čunu serial ekrana yazd─▒ral─▒m (kontrol i├žin)
          Serial.println(assets[currentAsset].assetName);
          Serial.println(payload);


          // Bilgileri OLED ekrana yazd─▒ral─▒m
          display.clearDisplay();
          logoCizdir(assets[currentAsset].logo);//logoyu ├žizdir
          okCizdir(change);//pozitif ise artan ok negatif ise d├╝┼čen oku ├žizdirecek
          degerYazdir(price);//de─čeri yazd─▒r
          degisimiYazdir(changePercent);//de─či┼čim y├╝zdesini yazd─▒r
          display.setTextSize(1);
          isminiYazdir(nick);//de─čeri yazd─▒r
          display.setTextSize(2);
          // Bir sonraki coin'i g├Âstermek i├žin
          currentAsset++;//sayac─▒ bir artt─▒rd─▒k
          if (currentAsset >= maxAssets) { //sona geldiysek ba┼ča ├ževirdik
            currentAsset = 0;
          }
        }
      }
      else { //negatif bir cevap kodu d├Ânm├╝┼čse
        // Serial ekran ve OLED ekran kullan─▒larak hata bildirimi yap─▒yoruz.
        Serial.printf("[HTTPS] GET... failed, error: %s\n", https.errorToString(httpCode).c_str());
        display.clearDisplay();
        display.setTextSize(1);
        display.setCursor(0, display.height() / 4);
        display.println(F("HTTPS GET hatasi"));
        display.print(F("Birka├ž saniye i├žinde yeniden denenecek"));
        display.setTextSize(2);
      }

      // https ba─člant─▒s─▒n─▒ i┼čimiz bitince sonland─▒rmal─▒y─▒z.
      https.end();
    }
    else {
      // API ile ba─člant─▒ sa─članamam─▒┼čsa
      Serial.println("API'ya ba─član─▒lam─▒yor");
      display.clearDisplay();
      display.setTextSize(1);
      display.setCursor(0, display.height() / 4);
      display.println(F("Baglanti Hatasi"));
      display.print(F("Tekrar Denenecek"));
      display.setTextSize(2);
    }
  }

  Serial.print("Bir sonraki d├Âng├╝ i├žin bekleyin...\n\n");
  delay(UPDATE_TIME * 1000);
}

// OLED ekrana logolar─▒ yazd─▒rmak i├žin kulland─▒─č─▒m─▒z prosed├╝r
void logoCizdir(const unsigned char logo []) {
  display.drawBitmap(0,
                     (display.height() + (display.height() / 4) - LOGO_YUKSEKLIK) / 2,
                     logo, LOGO_GENISLIK, LOGO_YUKSEKLIK, 1);
  display.display();
}

// Yukar─▒ / A┼ča─č─▒ Trend Oklar─▒n─▒ yazd─▒ran prosed├╝r
void okCizdir(float change) {//de─či┼čimin de─čerine bak─▒p a┼ča─č─▒ / yukar─▒ oka karar verece─čiz
  if (change >= 0) {
    display.drawBitmap(display.width() - OK_GENISLIK, display.height() - OK_YUKSEKLIK, stonks, OK_GENISLIK, OK_YUKSEKLIK, 1);
    
  }
  else {
    display.drawBitmap(display.width() - OK_GENISLIK, display.height() - OK_YUKSEKLIK, notstonks, OK_GENISLIK, OK_YUKSEKLIK, 1);
  }
  display.display();
}

// OLED ekrana coin de─čerini yazd─▒rd─▒─č─▒m─▒z prosed├╝r
void degerYazdir(float price) {
  char priceBuf[20];
  // Kullan─▒lan para birimi sembol├╝
  char currencySymbol = '$';
  currencySymbol = CURRENCY_SYM;
  // De─čer metnini ┼čekillendirelim
  if (price < 10) {
    sprintf(priceBuf, "%c%.5f", currencySymbol, price);
  }
  else {
    sprintf(priceBuf, "%c%.3f", currencySymbol, price);
  }
  // Ekran─▒ ortalamak i├žin metin boyutu bilgisine ihtiyac─▒m─▒z var
  int16_t x1, y1;
  uint16_t w, h;
  display.getTextBounds(priceBuf, 0, 0, &x1, &y1, &w, &h);
  // Cursor'u ekran─▒ ortalayacak pozisyona al─▒yoruz.
  display.setCursor((display.width() - w) / 2, 0);
  // ekrana yazd─▒ral─▒m.
  display.print(priceBuf);
  display.display();
}


// De─čerdeki oransal de─či┼čimi yazd─▒rd─▒─č─▒m─▒z prosed├╝r
void degisimiYazdir(float change) {
  display.setCursor(LOGO_GENISLIK + 10, display.height() / 4 + 2);
  // Pozitif de─či┼čimler i├žin + i┼čareti ekleyelim.
  if (change >= 0) {
    display.print(F("+"));
  }
  // de─či┼čim y├╝zdesi 10'dan az ise bir hane ondal─▒k ekleyelim
  if (abs(change) < 10) {
    display.print(change, 1);
  }
  else {
    display.print(change, 0);
  }
  display.print(F("%"));
  display.display();
}
void leds(float change) {
  if (change > 0) {
digitalWrite(upLED, HIGH);
digitalWrite(downLED, LOW);
digitalWrite(blue, LOW);
}
else if (change < 0) {
 digitalWrite(downLED, HIGH);
 digitalWrite(upLED, LOW);
 digitalWrite(blue, LOW);
}
else {
 digitalWrite(downLED, LOW);
 digitalWrite(upLED, LOW);
 digitalWrite(blue, HIGH);
}
  }

// COIN k─▒saltmas─▒n─▒ yazd─▒rd─▒─č─▒m─▒z prosed├╝r
void isminiYazdir(String nick) {
  display.setCursor(LOGO_GENISLIK + 5, display.height() / 4 * 3);
  // Pozitif de─či┼čimler i├žin + i┼čareti ekleyelim.
  display.print(nick);
  display.display();
}