//#include "Adafruit_GFX.h"
#include "Adafruit_TFTLCD.h" // Biblioteca específica para el LCD
#include "math.h"
#include "Adafruit_ILI9341.h"
#include "SPI.h"
#define TamanoBoton 60
// Definición de pines
#define TFT_DC 9
#define TFT_CS 10
int a = 10;
int b = 80;
char caracteres[] = "+-x=/";
char numero[]= "7894561230";
int num = 0;
int n = 0;
// Definición de colores
#define negro 0x0000
#define BLUE 0x001F
#define rojo 0xF800
#define GREEN 0x07E0
#define CYAN 0x07FF
#define MAGENTA 0xF81F
#define YELLOW 0xFFE0
#define blanco 0xFFFF
#define gris 0x9b9b
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
// Pin donde está conectado el micrófono
void setup(void) {
tft.begin();
tft.setTextColor(negro);
tft.setTextSize(5);
tft.fillScreen(gris);
//Fila 0
tft.fillRect(0, 0, TamanoBoton*4, TamanoBoton+13, blanco);
int a = 0;
int b = TamanoBoton;
char caracteres[] = "+-X=/";
char numeros[]= "7894561230";
int num = 0;
int n = 0;
for(int i=1;i<=4;i++){
a = 0;
for(int j=1;j<=4;j++){
if((j>=1&&j<=3)&&(i>=1&&i<=3) || (j==2&&i==4)){
tft.fillRect(a , b+15, TamanoBoton-2, TamanoBoton-2, blanco);
tft.setCursor(a+15,b+25);
tft.setTextColor(negro);
tft.print(numeros[num]);
num++;
}
else if(j==4&&(i>=1||i<=3)||(j==3 && i==4)){
tft.fillRect(a , b+15, TamanoBoton-2, TamanoBoton-2, negro);
tft.setCursor(a+15,b+25);
tft.setTextColor(blanco);
tft.print(caracteres[n]);
n++;
}
else if(j==1&&i==4){
tft.fillRect(a , b+15, TamanoBoton-2, TamanoBoton-2, rojo);
tft.setCursor(a+15,b+25);
tft.setTextColor(blanco);
tft.print("C");
}
a = a + TamanoBoton ;}
b = b + TamanoBoton;}
}
void loop(void) {
}