/*
ESP32 HTTPClient Jokes API Example
https://wokwi.com/projects/342032431249883731
Copyright (C) 2022, Uri Shaked
*/
#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h>
#include <vector>
std::vector<int> V1 = {1,2,3,4,5,6};
// For the Adafruit shield, these are the default.
#define TFT_DC 9
#define TFT_CS 10
// Use hardware SPI (on Uno, #13, #12, #11) and the above for CS/DC
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
void setup() {
Serial.begin(9600);
Serial.println("Welcome to C++ Learning");
tft.begin();
}
void loop(void) {
#if 0
tft.fillScreen(ILI9341_BLACK);
tft.setCursor(2, 2);
tft.setTextColor(ILI9341_WHITE);
tft.setTextSize(2);
tft.println("Hello World!");
Serial.print("Hello World!");
delay(1000);
#else
testRects(ILI9341_GREEN);
delay(1000);
#endif
}
unsigned long testRects(uint16_t color) {
unsigned long start;
int n, i, i2,
cx = tft.width() / 2,
cy = tft.height() / 2;
Serial.print("cx = ");
Serial.println(cx);
Serial.print("cy = ");
Serial.println(cy);
tft.fillScreen(ILI9341_BLACK);
tft.drawRect(cx, cy, 50, 50, color);
return micros() - start;
}