/*
ESP32 HTTPClient Jokes API Example
https://wokwi.com/projects/342032431249883731
Copyright (C) 2022, Uri Shaked
*/
#include "SPI.h"
#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h>
#include "dragon.h"
const char* ssid = "Wokwi-GUEST";
const char* password = "";
#define BTN_PIN 5
#define TFT_DC 2
#define TFT_CS 15
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
uint16_t x;
uint16_t y;
uint16_t renk;
void setup() {
x = 0;
y = 0;
renk = 0;
pinMode(BTN_PIN, INPUT_PULLUP);
tft.begin();
tft.setRotation(1);
}
void loop(void) {
if (digitalRead(BTN_PIN) == LOW) {
if(x >360){
x = 0;
}
if(y >260){
y = 0;
}
x++;
y += 2;
tft.drawPixel(x,y,random(0,65000));
}
}