#include "SPI.h"
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"
#define TFT_CS 5
#define TFT_DC 2
#define TFT_MOSI 23
#define TFT_CLK 18
#define TFT_RST 4
#define TFT_MISO 19
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_MOSI, TFT_CLK, TFT_RST, TFT_MISO);
void setup() {
tft.begin();
tft.setRotation (1);
tft.fillScreen(tft.color565(14,108,116)); // لون الخلفيه مال شاشه يخبل
}
void loop() {
btON(70,72);
delay(500);
btOFF(70,72);
delay(500);
btON(26,27);
delay(500);
btOFF(26,27);
delay(500);
}
void btON(byte x , byte x2){
tft.drawRoundRect(230, x, 80, 35,15, tft.color565(19, 181, 250));
tft.fillRoundRect(232, x2, 65, 30,14, tft.color565(134, 197, 71)); // لون وحجم خلفيه الدكمه اخضر
tft.fillRoundRect(273, x2, 35, 30,14, tft.color565(182, 221, 243));
}
void btOFF(byte x3 , byte x4){
tft.drawRoundRect(230, x3, 80, 35,15, tft.color565(19, 181, 250));
tft.fillRoundRect(242, x4, 65, 30,14, tft.color565(221, 39, 39)); // لون وحجم خلفيه الدكمه احمر
tft.fillRoundRect(232, x4, 35, 30,14, tft.color565(182, 221, 243));
}