#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h>
#define TFT_CS 5
#define TFT_RST 4
#define TFT_DC 2
#define TFT_MISO 19
#define TFT_MOSI 23
#define TFT_CLK 18
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
//Variables para pulsadores
const byte BotonA = 14;
const byte BotonB = 27;
const byte BotonC = 26;
byte estadoPulsador1 = 0, decisionPulsador1 = 1;
byte estadoPulsador2 = 0, decisionPulsador2 = 1;
byte estadoPulsador3 = 0, decisionPulsador3 = 1;
//Variable etapas
int etapa = 0;
//Variables Argollas
int ua = 195, da = 195, ca = 195, uma = 195, dma = 195, cma = 195, ma = 195;
//Variables numeros SND
int U = 0, D = 0, C = 0, Um = 0, Rs = 0, V = 3;
long Dm = 0, Cm = 0, M = 0, R, Rd;
char bufferString[32];
void setup() {
Serial.begin(9600);
tft.begin();
pinMode(BotonA, INPUT);
pinMode(BotonB, INPUT);
pinMode(BotonC, INPUT);
pinMode(12, OUTPUT);
randomSeed(analogRead(34));
tft.setRotation(3);
tft.fillScreen(ILI9341_WHITE); // Fondo de pantalla
}
void loop() {
estadoPulsador1 = digitalRead(BotonA);
estadoPulsador2 = digitalRead(BotonB);
estadoPulsador3 = digitalRead(BotonC);
switch (etapa) {
case 0:
base4();
delay(1000);
tft.fillScreen(ILI9341_WHITE); // Fondo de pantalla para limpiar
etapa = 1;
break;
case 1:
if (estadoPulsador1 != decisionPulsador1) {
delay (50);
if (estadoPulsador1 == HIGH) {
digitalWrite(12, HIGH);
delay(100);
digitalWrite(12, LOW);
delay(100);
tft.fillScreen(ILI9341_WHITE); // Fondo de pantalla para limpiar
base1();
etapa = 11;
}
}
decisionPulsador1 = estadoPulsador1;
if (estadoPulsador2 != decisionPulsador2) {
delay (50);
if (estadoPulsador2 == HIGH) {
digitalWrite(12, HIGH);
delay(100);
digitalWrite(12, LOW);
delay(100);
digitalWrite(12, HIGH);
delay(100);
digitalWrite(12, LOW);
delay(100);
tft.fillScreen(ILI9341_WHITE); // Fondo de pantalla para limpiar
base2();
Rd = random(1, 99);
etapa = 22;
}
}
decisionPulsador2 = estadoPulsador2;
if (estadoPulsador3 != decisionPulsador3) {
if (estadoPulsador3 == HIGH) {
digitalWrite(12, HIGH);
delay(100);
digitalWrite(12, LOW);
delay(100);
digitalWrite(12, HIGH);
delay(100);
digitalWrite(12, LOW);
delay(100);
digitalWrite(12, HIGH);
delay(100);
digitalWrite(12, LOW);
delay(100);
tft.fillScreen(ILI9341_WHITE); // Fondo de pantalla para limpiar
base7();
etapa = 17;
}
}
decisionPulsador3 = estadoPulsador3;
delay(10); // this speeds up the simulation
break;
case 11:
// argollas 1 cifras
R = ((U * 1));
tft.setTextColor(ILI9341_BLACK, ILI9341_WHITE), tft.setTextSize(3), tft.setCursor(106, 25);
sprintf(bufferString, "mero: %-d", R);
tft.print(bufferString);
tft.setCursor(70, 25), tft.print("N"), tft.write(0xA3); //ú +18 ancho
// Unidades
if (estadoPulsador1 != decisionPulsador1) {
delay (50);
if (estadoPulsador1 == HIGH) {
digitalWrite(12, HIGH);
U = U + 1;
ua = ua - 13;
delay(100);
digitalWrite(12, LOW);
if ( U > 9) {
U = 0;
}
//1
if (ua == 182) {
tft.fillRoundRect(140, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(140, ua, 40, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//2
if (ua == 169) {
tft.fillRoundRect(140, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(140, ua, 40, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//3
if (ua == 156) {
tft.fillRoundRect(140, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(140, ua, 40, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//4
if (ua == 143) {
tft.fillRoundRect(140, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(140, ua, 40, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//5
if (ua == 130) {
tft.fillRoundRect(140, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(140, ua, 40, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//6
if (ua == 117) {
tft.fillRoundRect(140, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(140, ua, 40, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//7
if (ua == 104) {
tft.fillRoundRect(140, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(140, ua, 40, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//8
if (ua == 91) {
tft.fillRoundRect(140, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(140, ua, 40, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//9
if (ua == 78) {
tft.fillRoundRect(140, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(140, ua, 40, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//0
if (ua <= 77) {
//poste en blanco
ua = 195;
tft.fillRect(135, 68, 50, 128, ILI9341_WHITE); //recuadro blanco
tft.fillRect(135, 190, 50, 6, ILI9341_YELLOW); //relleno amarillo
tft.drawLine(135, 190, 185, 190, ILI9341_BLACK);
//Poste Unidades
tft.fillRoundRect(155, 70, 10, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(160, 74, 5, ILI9341_BLACK); // Círculo arriba
tft.fillRect(156, 75, 9, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(155, 74, 155, 195, ILI9341_BLACK);
tft.drawLine(165, 74, 165, 195, ILI9341_BLACK);
tft.drawLine(155, 74, 165, 74, ILI9341_BLACK);
}
}
}
decisionPulsador1 = estadoPulsador1;
delay(10);
break;
case 12:
// argollas 2 cifras
R = ((D * 10) + (U * 1));
tft.setTextColor(ILI9341_BLACK, ILI9341_WHITE), tft.setTextSize(3), tft.setCursor(106, 25);
sprintf(bufferString, "mero: %-2d", R);
tft.print(bufferString);
tft.setCursor(70, 25), tft.print("N"), tft.write(0xA3); //ú +18 ancho
// Unidades
if (estadoPulsador1 != decisionPulsador1) {
delay (50);
if (estadoPulsador1 == HIGH) {
digitalWrite(12, HIGH);
U = U + 1;
ua = ua - 13;
delay(100);
digitalWrite(12, LOW);
if ( U > 9) {
U = 0;
}
//1
if (ua == 182) {
tft.fillRoundRect(170, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla
tft.drawRoundRect(170, ua, 40, 13, 5, ILI9341_BLACK);
}
//2
if (ua == 169) {
tft.fillRoundRect(170, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla
tft.drawRoundRect(170, ua, 40, 13, 5, ILI9341_BLACK);
}
//3
if (ua == 156) {
tft.fillRoundRect(170, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla
tft.drawRoundRect(170, ua, 40, 13, 5, ILI9341_BLACK);
}
//4
if (ua == 143) {
tft.fillRoundRect(170, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla
tft.drawRoundRect(170, ua, 40, 13, 5, ILI9341_BLACK);
}
//5
if (ua == 130) {
tft.fillRoundRect(170, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla
tft.drawRoundRect(170, ua, 40, 13, 5, ILI9341_BLACK);
}
//6
if (ua == 117) {
tft.fillRoundRect(170, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla
tft.drawRoundRect(170, ua, 40, 13, 5, ILI9341_BLACK);
}
//7
if (ua == 104) {
tft.fillRoundRect(170, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla
tft.drawRoundRect(170, ua, 40, 13, 5, ILI9341_BLACK);
}
//8
if (ua == 91) {
tft.fillRoundRect(170, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla
tft.drawRoundRect(170, ua, 40, 13, 5, ILI9341_BLACK);
}
//9
if (ua == 78) {
tft.fillRoundRect(170, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla
tft.drawRoundRect(170, ua, 40, 13, 5, ILI9341_BLACK);
}
//0
if (ua <= 77) {
//poste en blanco
ua = 195;
tft.fillRect(165, 68, 50, 128, ILI9341_WHITE); //recuadro blanco
tft.fillRect(165, 190, 50, 6, ILI9341_YELLOW); //relleno amarillo
tft.drawLine(165, 190, 215, 190, ILI9341_BLACK);
//Poste Unidades
tft.fillRoundRect(185, 70, 10, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(190, 74, 5, ILI9341_BLACK); // Círculo arriba
tft.fillRect(186, 75, 9, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(185, 74, 185, 195, ILI9341_BLACK);
tft.drawLine(195, 74, 195, 195, ILI9341_BLACK);
tft.drawLine(185, 74, 195, 74, ILI9341_BLACK);
}
}
}
decisionPulsador1 = estadoPulsador1;
// Decenas
if (estadoPulsador2 != decisionPulsador2) {
delay (50);
if (estadoPulsador2 == HIGH) {
digitalWrite(12, HIGH);
D = D + 1;
da = da - 13;
delay(100);
digitalWrite(12, LOW);
if (D > 9) {
D = 0;
}
//1
if (da == 182) {
tft.fillRoundRect(110, da, 40, 13, 5, ILI9341_GREEN); //Argolla
tft.drawRoundRect(110, da, 40, 13, 5, ILI9341_BLACK);
}
//2
if (da == 169) {
tft.fillRoundRect(110, da, 40, 13, 5, ILI9341_GREEN); //Argolla
tft.drawRoundRect(110, da, 40, 13, 5, ILI9341_BLACK);
}
//3
if (da == 156) {
tft.fillRoundRect(110, da, 40, 13, 5, ILI9341_GREEN); //Argolla
tft.drawRoundRect(110, da, 40, 13, 5, ILI9341_BLACK);
}
//4
if (da == 143) {
tft.fillRoundRect(110, da, 40, 13, 5, ILI9341_GREEN); //Argolla
tft.drawRoundRect(110, da, 40, 13, 5, ILI9341_BLACK);
}
//5
if (da == 130) {
tft.fillRoundRect(110, da, 40, 13, 5, ILI9341_GREEN); //Argolla
tft.drawRoundRect(110, da, 40, 13, 5, ILI9341_BLACK);
}
//6
if (da == 117) {
tft.fillRoundRect(110, da, 40, 13, 5, ILI9341_GREEN); //Argolla
tft.drawRoundRect(110, da, 40, 13, 5, ILI9341_BLACK);
}
//7
if (da == 104) {
tft.fillRoundRect(110, da, 40, 13, 5, ILI9341_GREEN); //Argolla
tft.drawRoundRect(110, da, 40, 13, 5, ILI9341_BLACK);
}
//8
if (da == 91) {
tft.fillRoundRect(110, da, 40, 13, 5, ILI9341_GREEN); //Argolla
tft.drawRoundRect(110, da, 40, 13, 5, ILI9341_BLACK);
}
//9
if (da == 78) {
tft.fillRoundRect(110, da, 40, 13, 5, ILI9341_GREEN); //Argolla
tft.drawRoundRect(110, da, 40, 13, 5, ILI9341_BLACK);
}
//0
if (da <= 77) {
//poste en blanco
da = 195;
tft.fillRect(105, 68, 50, 128, ILI9341_WHITE); //recdadro blanco
tft.fillRect(105, 190, 50, 6, ILI9341_YELLOW); //relleno amarillo
tft.drawLine(105, 190, 155, 190, ILI9341_BLACK);
//Poste Decenas
tft.fillRoundRect(125, 70, 10, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(130, 74, 5, ILI9341_BLACK); // Círculo arriba
tft.fillRect(126, 75, 9, 6, ILI9341_YELLOW); //cdadro para tapar círculo
tft.drawLine(125, 74, 125, 195, ILI9341_BLACK);
tft.drawLine(135, 74, 135, 195, ILI9341_BLACK);
tft.drawLine(125, 74, 135, 74, ILI9341_BLACK);
}
}
}
decisionPulsador2 = estadoPulsador2;
delay(10);
break;
case 13:
// argollas 3 cifras
R = ((C * 100) + (D * 10) + (U * 1));
tft.setTextColor(ILI9341_BLACK, ILI9341_WHITE), tft.setTextSize(3), tft.setCursor(100, 25);
sprintf(bufferString, "mero: %-3d", R);
tft.print(bufferString);
tft.setCursor(64, 25), tft.print("N"), tft.write(0xA3); //ú +18 ancho
// Unidades
if (estadoPulsador1 != decisionPulsador1) {
delay (50);
if (estadoPulsador1 == HIGH) {
digitalWrite(12, HIGH);
U = U + 1;
ua = ua - 13;
delay(100);
digitalWrite(12, LOW);
if (U > 9) {
U = 0;
}
//1
if (ua == 182) {
tft.fillRoundRect(200, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(200, ua, 40, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//2
if (ua == 169) {
tft.fillRoundRect(200, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(200, ua, 40, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//3
if (ua == 156) {
tft.fillRoundRect(200, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(200, ua, 40, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//4
if (ua == 143) {
tft.fillRoundRect(200, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(200, ua, 40, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//5
if (ua == 130) {
tft.fillRoundRect(200, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(200, ua, 40, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//6
if (ua == 117) {
tft.fillRoundRect(200, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(200, ua, 40, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//7
if (ua == 104) {
tft.fillRoundRect(200, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(200, ua, 40, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//8
if (ua == 91) {
tft.fillRoundRect(200, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(200, ua, 40, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//9
if (ua == 78) {
tft.fillRoundRect(200, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(200, ua, 40, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//0
if (ua <= 77) {
//poste en blanco
ua = 195;
tft.fillRect(195, 68, 50, 128, ILI9341_WHITE); //recuadro blanco
tft.fillRect(195, 190, 50, 6, ILI9341_YELLOW); //relleno amarillo
tft.drawLine(195, 190, 250, 190, ILI9341_BLACK);
//Poste Unidades
tft.fillRoundRect(215, 70, 10, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(220, 74, 5, ILI9341_BLACK); // Círculo arriba
tft.fillRect(216, 75, 9, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(215, 74, 215, 195, ILI9341_BLACK);
tft.drawLine(225, 74, 225, 195, ILI9341_BLACK);
tft.drawLine(215, 74, 225, 74, ILI9341_BLACK);
}
}
}
decisionPulsador1 = estadoPulsador1;
// Decenas
if (estadoPulsador2 != decisionPulsador2) {
delay (50);
if (estadoPulsador2 == HIGH) {
digitalWrite(12, HIGH);
D = D + 1;
da = da - 13;
delay(100);
digitalWrite(12, LOW);
if (D > 9) {
D = 0;
}
//1
if (da == 182) {
tft.fillRoundRect(140, da, 40, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(140, da, 40, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//2
if (da == 169) {
tft.fillRoundRect(140, da, 40, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(140, da, 40, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//3
if (da == 156) {
tft.fillRoundRect(140, da, 40, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(140, da, 40, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//4
if (da == 143) {
tft.fillRoundRect(140, da, 40, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(140, da, 40, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//5
if (da == 130) {
tft.fillRoundRect(140, da, 40, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(140, da, 40, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//6
if (da == 117) {
tft.fillRoundRect(140, da, 40, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(140, da, 40, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//7
if (da == 104) {
tft.fillRoundRect(140, da, 40, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(140, da, 40, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//8
if (da == 91) {
tft.fillRoundRect(140, da, 40, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(140, da, 40, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//9
if (da == 78) {
tft.fillRoundRect(140, da, 40, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(140, da, 40, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//0
if (da <= 77) {
//poste en blanco
da = 195;
tft.fillRect(135, 68, 50, 128, ILI9341_WHITE); //recdadro blanco
tft.fillRect(135, 190, 50, 6, ILI9341_YELLOW); //relleno amarillo
tft.drawLine(135, 190, 185, 190, ILI9341_BLACK);
//Poste Decenas
tft.fillRoundRect(155, 70, 10, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(160, 74, 5, ILI9341_BLACK); // Círculo arriba
tft.fillRect(156, 75, 9, 6, ILI9341_YELLOW); //cdadro para tapar círculo
tft.drawLine(155, 74, 155, 195, ILI9341_BLACK);
tft.drawLine(165, 74, 165, 195, ILI9341_BLACK);
tft.drawLine(155, 74, 165, 74, ILI9341_BLACK);
}
}
}
decisionPulsador2 = estadoPulsador2;
// Centenas
if (estadoPulsador3 != decisionPulsador3) {
delay (50);
if (estadoPulsador3 == HIGH) {
digitalWrite(12, HIGH);
C = C + 1;
ca = ca - 13;
delay(100);
digitalWrite(12, LOW);
if (C > 9) {
C = 0;
}
//1
if (ca == 182) {
tft.fillRoundRect(80, ca, 40, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(80, ca, 40, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//2
if (ca == 169) {
tft.fillRoundRect(80, ca, 40, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(80, ca, 40, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//3
if (ca == 156) {
tft.fillRoundRect(80, ca, 40, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(80, ca, 40, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//4
if (ca == 143) {
tft.fillRoundRect(80, ca, 40, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(80, ca, 40, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//5
if (ca == 130) {
tft.fillRoundRect(80, ca, 40, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(80, ca, 40, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//6
if (ca == 117) {
tft.fillRoundRect(80, ca, 40, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(80, ca, 40, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//7
if (ca == 104) {
tft.fillRoundRect(80, ca, 40, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(80, ca, 40, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//8
if (ca == 91) {
tft.fillRoundRect(80, ca, 40, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(80, ca, 40, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//9
if (ca == 78) {
tft.fillRoundRect(80, ca, 40, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(80, ca, 40, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//0
if (ca <= 77) {
//poste en blanco
ca = 195;
tft.fillRect(75, 68, 50, 128, ILI9341_WHITE); //reccadro blanco
tft.fillRect(75, 190, 50, 6, ILI9341_YELLOW); //relleno amarillo
tft.drawLine(75, 190, 125, 190, ILI9341_BLACK);
//Poste Centenas
tft.fillRoundRect(95, 70, 10, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(100, 74, 5, ILI9341_BLACK); // Círculo arriba
tft.fillRect(96, 75, 9, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(95, 74, 95, 195, ILI9341_BLACK);
tft.drawLine(105, 74, 105, 195, ILI9341_BLACK);
tft.drawLine(95, 74, 105, 74, ILI9341_BLACK);
}
}
}
decisionPulsador3 = estadoPulsador3;
delay(10);
break;
case 14:
// argollas 4 cifras
R = ((Um * 1000) + (C * 100) + (D * 10) + (U * 1));
tft.setTextColor(ILI9341_BLACK, ILI9341_WHITE), tft.setTextSize(3), tft.setCursor(90, 25);
sprintf(bufferString, "mero: %-4d", R);
tft.print(bufferString);
tft.setCursor(54, 25), tft.print("N"), tft.write(0xA3); //ú +18 ancho
// Unidades
if (estadoPulsador1 != decisionPulsador1) {
delay (50);
if (estadoPulsador1 == HIGH) {
digitalWrite(12, HIGH);
U = U + 1;
ua = ua - 13;
delay(100);
digitalWrite(12, LOW);
if (U > 9) {
U = 0;
}
//1
if (ua == 182) {
tft.fillRoundRect(240, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(240, ua, 40, 13, 5, ILI9341_BLACK);
}
//2
if (ua == 169) {
tft.fillRoundRect(240, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(240, ua, 40, 13, 5, ILI9341_BLACK);
}
//3
if (ua == 156) {
tft.fillRoundRect(240, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(240, ua, 40, 13, 5, ILI9341_BLACK);
}
//4
if (ua == 143) {
tft.fillRoundRect(240, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(240, ua, 40, 13, 5, ILI9341_BLACK);
}
//5
if (ua == 130) {
tft.fillRoundRect(240, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(240, ua, 40, 13, 5, ILI9341_BLACK);
}
//6
if (ua == 117) {
tft.fillRoundRect(240, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(240, ua, 40, 13, 5, ILI9341_BLACK);
}
//7
if (ua == 104) {
tft.fillRoundRect(240, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(240, ua, 40, 13, 5, ILI9341_BLACK);
}
//8
if (ua == 91) {
tft.fillRoundRect(240, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(240, ua, 40, 13, 5, ILI9341_BLACK);
}
//9
if (ua == 78) {
tft.fillRoundRect(240, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(240, ua, 40, 13, 5, ILI9341_BLACK);
}
//0
if (ua <= 77) {
//poste en blanco
ua = 195;
tft.fillRect(238, 68, 45, 128, ILI9341_WHITE); //recuadro blanco
tft.fillRect(238, 190, 45, 6, ILI9341_YELLOW); //relleno amarillo
tft.drawLine(238, 190, 285, 190, ILI9341_BLACK);
//Poste Unidades
tft.fillRoundRect(255, 70, 10, 125, 4, ILI9341_YELLOW);
tft.drawCircle(260, 74, 5, ILI9341_BLACK); // Círculo arriba
tft.fillRect(256, 75, 9, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(255, 74, 255, 195, ILI9341_BLACK);
tft.drawLine(265, 74, 265, 195, ILI9341_BLACK);
tft.drawLine(255, 74, 265, 74, ILI9341_BLACK);
}
}
}
decisionPulsador1 = estadoPulsador1;
// Decenas
/*if (estadoPulsador2 != decisionPulsador2) {
delay (50);
if (estadoPulsador2 == HIGH) {
digitalWrite(12, HIGH);
D = D +1;
da = da - 13;
delay(100);
digitalWrite(12, LOW);
if(D>9){
D = 0;
}
//1
if (da == 182) {
tft.fillRoundRect(175, da, 40, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(175, da, 40, 13, 5, ILI9341_BLACK);
}
//2
if (da == 169) {
tft.fillRoundRect(175, da, 40, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(175, da, 40, 13, 5, ILI9341_BLACK);
}
//3
if (da == 156) {
tft.fillRoundRect(175, da, 40, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(175, da, 40, 13, 5, ILI9341_BLACK);
}
//4
if (da == 143) {
tft.fillRoundRect(175, da, 40, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(175, da, 40, 13, 5, ILI9341_BLACK);
}
//5
if (da == 130) {
tft.fillRoundRect(175, da, 40, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(175, da, 40, 13, 5, ILI9341_BLACK);
}
//6
if (da == 117) {
tft.fillRoundRect(175, da, 40, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(175, da, 40, 13, 5, ILI9341_BLACK);
}
//7
if (da == 104) {
tft.fillRoundRect(175, da, 40, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(175, da, 40, 13, 5, ILI9341_BLACK);
}
//8
if (da == 91) {
tft.fillRoundRect(175, da, 40, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(175, da, 40, 13, 5, ILI9341_BLACK);
}
//9
if (da == 78) {
tft.fillRoundRect(175, da, 40, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(175, da, 40, 13, 5, ILI9341_BLACK);
}
//0
if (da <= 77) {
//poste en blanco
da = 195;
tft.fillRect(173, 68, 45, 128, ILI9341_WHITE); //recdadro blanco
tft.fillRect(173, 190, 45, 6, ILI9341_YELLOW); //relleno amarillo
tft.drawLine(173, 190, 223, 190, ILI9341_BLACK);
//Poste Decenas
tft.fillRoundRect(190, 70, 10, 125, 4, ILI9341_YELLOW);
tft.drawCircle(195, 74, 5, ILI9341_BLACK); // Círculo arriba
tft.fillRect(191, 75, 9, 6, ILI9341_YELLOW); //cdadro para tapar círculo
tft.drawLine(190, 74, 190, 195, ILI9341_BLACK);
tft.drawLine(200, 74, 200, 195, ILI9341_BLACK);
tft.drawLine(190, 74, 200, 74, ILI9341_BLACK);
}
}
}
decisionPulsador2 = estadoPulsador2;*/
// Centenas
/*if (estadoPulsador3 != decisionPulsador3) {
delay (50);
if (estadoPulsador3 == HIGH) {
digitalWrite(12, HIGH);
C = C+1;
ca = ca - 13;
delay(100);
digitalWrite(12, LOW);
if(C>9){
C=0;
}
//1
if (ca == 182) {
tft.fillRoundRect(105, ca, 40, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(105, ca, 40, 13, 5, ILI9341_BLACK);
}
//2
if (ca == 169) {
tft.fillRoundRect(105, ca, 40, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(105, ca, 40, 13, 5, ILI9341_BLACK);
}
//3
if (ca == 156) {
tft.fillRoundRect(105, ca, 40, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(105, ca, 40, 13, 5, ILI9341_BLACK);
}
//4
if (ca == 143) {
tft.fillRoundRect(105, ca, 40, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(105, ca, 40, 13, 5, ILI9341_BLACK);
}
//5
if (ca == 130) {
tft.fillRoundRect(105, ca, 40, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(105, ca, 40, 13, 5, ILI9341_BLACK);
}
//6
if (ca == 117) {
tft.fillRoundRect(105, ca, 40, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(105, ca, 40, 13, 5, ILI9341_BLACK);
}
//7
if (ca == 104) {
tft.fillRoundRect(105, ca, 40, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(105, ca, 40, 13, 5, ILI9341_BLACK);
}
//8
if (ca == 91) {
tft.fillRoundRect(105, ca, 40, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(105, ca, 40, 13, 5, ILI9341_BLACK);
}
//9
if (ca == 78) {
tft.fillRoundRect(105, ca, 40, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(105, ca, 40, 13, 5, ILI9341_BLACK);
}
//0
if (ca <= 77) {
//poste en blanco
ca = 195;
tft.fillRect(103, 68, 45, 128, ILI9341_WHITE); //reccadro blanco
tft.fillRect(103, 190, 45, 6, ILI9341_YELLOW); //relleno amarillo
tft.drawLine(103, 190, 153, 190, ILI9341_BLACK);
//Poste Centenas
tft.fillRoundRect(120, 70, 10, 125, 4, ILI9341_YELLOW);
tft.drawCircle(125, 74, 5, ILI9341_BLACK); // Círculo arriba
tft.fillRect(121, 75, 9, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(120, 74, 120, 195, ILI9341_BLACK);
tft.drawLine(130, 74, 130, 195, ILI9341_BLACK);
tft.drawLine(120, 74, 130, 74, ILI9341_BLACK);
}
}
}
decisionPulsador3 = estadoPulsador3;*/
// Unidades de mil
/*if (estadoPulsador4 != decisionPulsador4) {
delay (50);
if (estadoPulsador4 == HIGH) {
digitalWrite(12, HIGH);
Um = Um + 1;
uma = uma - 13;
delay(100);
digitalWrite(12, LOW);
if (Um > 9) {
Um = 0;
}
//1
if (uma == 182) {
tft.fillRoundRect(40, uma, 40, 13, 5, ILI9341_BLUE); //Argolla1
tft.drawRoundRect(40, uma, 40, 13, 5, ILI9341_BLACK);
}
//2
if (uma == 169) {
tft.fillRoundRect(40, uma, 40, 13, 5, ILI9341_BLUE); //Argolla1
tft.drawRoundRect(40, uma, 40, 13, 5, ILI9341_BLACK);
}
//3
if (uma == 156) {
tft.fillRoundRect(40, uma, 40, 13, 5, ILI9341_BLUE); //Argolla1
tft.drawRoundRect(40, uma, 40, 13, 5, ILI9341_BLACK);
}
//4
if (uma == 143) {
tft.fillRoundRect(40, uma, 40, 13, 5, ILI9341_BLUE); //Argolla1
tft.drawRoundRect(40, uma, 40, 13, 5, ILI9341_BLACK);
}
//5
if (uma == 130) {
tft.fillRoundRect(40, uma, 40, 13, 5, ILI9341_BLUE); //Argolla1
tft.drawRoundRect(40, uma, 40, 13, 5, ILI9341_BLACK);
}
//6
if (uma == 117) {
tft.fillRoundRect(40, uma, 40, 13, 5, ILI9341_BLUE); //Argolla1
tft.drawRoundRect(40, uma, 40, 13, 5, ILI9341_BLACK);
}
//7
if (uma == 104) {
tft.fillRoundRect(40, uma, 40, 13, 5, ILI9341_BLUE); //Argolla1
tft.drawRoundRect(40, uma, 40, 13, 5, ILI9341_BLACK);
}
//8
if (uma == 91) {
tft.fillRoundRect(40, uma, 40, 13, 5, ILI9341_BLUE); //Argolla1
tft.drawRoundRect(40, uma, 40, 13, 5, ILI9341_BLACK);
}
//9
if (uma == 78) {
tft.fillRoundRect(40, uma, 40, 13, 5, ILI9341_BLUE); //Argolla1
tft.drawRoundRect(40, uma, 40, 13, 5, ILI9341_BLACK);
}
//0
if (uma <= 77) {
//poste en blanco
uma = 195;
tft.fillRect(38, 68, 45, 128, ILI9341_WHITE); //recumadro blanco
tft.fillRect(38, 190, 45, 6, ILI9341_YELLOW); //relleno amarillo
tft.drawLine(38, 190, 90, 190, ILI9341_BLACK);
//Poste Unidad de mil
tft.fillRoundRect(55, 70, 10, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(60, 74, 5, ILI9341_BLACK); // Círculo arriba
tft.fillRect(56, 75, 9, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(55, 74, 55, 195, ILI9341_BLACK);
tft.drawLine(65, 74, 65, 195, ILI9341_BLACK);
tft.drawLine(55, 74, 65, 74, ILI9341_BLACK);
}
}
}
decisionPulsador4 = estadoPulsador4;*/
delay(10);
break;
case 15:
// argollas 5 cifras
R = ((Dm * 10000) + (Um * 1000) + (C * 100) + (D * 10) + (U * 1));
tft.setTextColor(ILI9341_BLACK, ILI9341_WHITE), tft.setTextSize(3), tft.setCursor(80, 25);
sprintf(bufferString, "mero: %-5d", R);
tft.print(bufferString);
tft.setCursor(44, 25), tft.print("N"), tft.write(0xA3); //ú +18 ancho
// Unidades
if (estadoPulsador1 != decisionPulsador1) {
delay (50);
if (estadoPulsador1 == HIGH) {
digitalWrite(12, HIGH);
U = U + 1;
ua = ua - 13;
delay(100);
digitalWrite(12, LOW);
if (U > 9) {
U = 0;
}
//1
if (ua == 182) {
tft.fillRoundRect(238, ua, 37, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(238, ua, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//2
if (ua == 169) {
tft.fillRoundRect(238, ua, 37, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(238, ua, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//3
if (ua == 156) {
tft.fillRoundRect(238, ua, 37, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(238, ua, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//4
if (ua == 143) {
tft.fillRoundRect(238, ua, 37, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(238, ua, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//5
if (ua == 130) {
tft.fillRoundRect(238, ua, 37, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(238, ua, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//6
if (ua == 117) {
tft.fillRoundRect(238, ua, 37, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(238, ua, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//7
if (ua == 104) {
tft.fillRoundRect(238, ua, 37, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(238, ua, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//8
if (ua == 91) {
tft.fillRoundRect(238, ua, 37, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(238, ua, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//9
if (ua == 78) {
tft.fillRoundRect(238, ua, 37, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(238, ua, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//0
if (ua <= 77) {
//poste en blanco
ua = 195;
tft.fillRect(235, 68, 40, 128, ILI9341_WHITE); //recuadro blanco
tft.fillRect(235, 190, 40, 6, ILI9341_YELLOW); //relleno amarillo
tft.drawLine(235, 190, 275, 190, ILI9341_BLACK);
//Poste Unidades
tft.fillRoundRect(252, 70, 8, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(256, 74, 4, ILI9341_BLACK); // Círculo arriba
tft.fillRect(253, 75, 7, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(252, 74, 252, 195, ILI9341_BLACK);
tft.drawLine(260, 74, 260, 195, ILI9341_BLACK);
tft.drawLine(252, 74, 260, 74, ILI9341_BLACK);
}
}
}
decisionPulsador1 = estadoPulsador1;
// Decenas
/*if (estadoPulsador2 != decisionPulsador2) {
delay (50);
if (estadoPulsador2 == HIGH) {
digitalWrite(12, HIGH);
D=D+1;
da = da - 13;
delay(100);
digitalWrite(12, LOW);
if(D>9){
D=0;
}
//1
if (da == 182) {
tft.fillRoundRect(190, da, 37, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(190, da, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//2
if (da == 169) {
tft.fillRoundRect(190, da, 37, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(190, da, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//3
if (da == 156) {
tft.fillRoundRect(190, da, 37, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(190, da, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//4
if (da == 143) {
tft.fillRoundRect(190, da, 37, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(190, da, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//5
if (da == 130) {
tft.fillRoundRect(190, da, 37, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(190, da, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//6
if (da == 117) {
tft.fillRoundRect(190, da, 37, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(190, da, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//7
if (da == 104) {
tft.fillRoundRect(190, da, 37, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(190, da, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//8
if (da == 91) {
tft.fillRoundRect(190, da, 37, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(190, da, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//9
if (da == 78) {
tft.fillRoundRect(190, da, 37, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(190, da, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//0
if (da <= 77) {
//poste en blanco
da = 195;
tft.fillRect(185, 68, 44, 128, ILI9341_WHITE); //recdadro blanco
tft.fillRect(185, 190, 44, 6, ILI9341_YELLOW); //relleno amarillo
tft.drawLine(185, 190, 230, 190, ILI9341_BLACK);
//Poste Decenas
tft.fillRoundRect(204, 70, 8, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(208, 74, 4, ILI9341_BLACK); // Círculo arriba
tft.fillRect(205, 75, 7, 6, ILI9341_YELLOW); //cdadro para tapar círculo
tft.drawLine(204, 74, 204, 195, ILI9341_BLACK);
tft.drawLine(212, 74, 212, 195, ILI9341_BLACK);
tft.drawLine(204, 74, 212, 74, ILI9341_BLACK);
}
}
}
decisionPulsador2 = estadoPulsador2;*/
// Centenas
/*if (estadoPulsador3 != decisionPulsador3) {
delay (50);
if (estadoPulsador3 == HIGH) {
digitalWrite(12, HIGH);
C=C+1;
ca = ca - 13;
delay(100);
digitalWrite(12, LOW);
if(C>9){
C=0;
}
//1
if (ca == 182) {
tft.fillRoundRect(142, ca, 37, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(142, ca, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//2
if (ca == 169) {
tft.fillRoundRect(142, ca, 37, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(142, ca, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//3
if (ca == 156) {
tft.fillRoundRect(142, ca, 37, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(142, ca, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//4
if (ca == 143) {
tft.fillRoundRect(142, ca, 37, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(142, ca, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//5
if (ca == 130) {
tft.fillRoundRect(142, ca, 37, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(142, ca, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//6
if (ca == 117) {
tft.fillRoundRect(142, ca, 37, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(142, ca, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//7
if (ca == 104) {
tft.fillRoundRect(142, ca, 37, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(142, ca, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//8
if (ca == 91) {
tft.fillRoundRect(142, ca, 37, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(142, ca, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//9
if (ca == 78) {
tft.fillRoundRect(142, ca, 37, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(142, ca, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//0
if (ca <= 77) {
//poste en blanco
ca = 195;
tft.fillRect(140, 68, 44, 128, ILI9341_WHITE); //reccadro blanco
tft.fillRect(140, 190, 44, 6, ILI9341_YELLOW); //relleno amarillo
tft.drawLine(140, 190, 190, 190, ILI9341_BLACK);
//Poste Centenas
tft.fillRoundRect(156, 70, 8, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(160, 74, 4, ILI9341_BLACK); // Círculo arriba
tft.fillRect(157, 75, 7, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(156, 74, 156, 195, ILI9341_BLACK);
tft.drawLine(164, 74, 164, 195, ILI9341_BLACK);
tft.drawLine(156, 74, 164, 74, ILI9341_BLACK);
}
}
}
decisionPulsador3 = estadoPulsador3;*/
// Unidades de Mil
/*if (estadoPulsador4 != decisionPulsador4) {
delay (50);
if (estadoPulsador4 == HIGH) {
digitalWrite(12, HIGH);
Um=Um+1;
uma = uma - 13;
delay(100);
digitalWrite(12, LOW);
if(Um>9){
Um=0;
}
//1
if (uma == 182) {
tft.fillRoundRect(94, uma, 37, 13, 5, ILI9341_BLUE); //Argolla1
tft.drawRoundRect(94, uma, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//2
if (uma == 169) {
tft.fillRoundRect(94, uma, 37, 13, 5, ILI9341_BLUE); //Argolla1
tft.drawRoundRect(94, uma, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//3
if (uma == 156) {
tft.fillRoundRect(94, uma, 37, 13, 5, ILI9341_BLUE); //Argolla1
tft.drawRoundRect(94, uma, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//4
if (uma == 143) {
tft.fillRoundRect(94, uma, 37, 13, 5, ILI9341_BLUE); //Argolla1
tft.drawRoundRect(94, uma, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//5
if (uma == 130) {
tft.fillRoundRect(94, uma, 37, 13, 5, ILI9341_BLUE); //Argolla1
tft.drawRoundRect(94, uma, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//6
if (uma == 117) {
tft.fillRoundRect(94, uma, 37, 13, 5, ILI9341_BLUE); //Argolla1
tft.drawRoundRect(94, uma, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//7
if (uma == 104) {
tft.fillRoundRect(94, uma, 37, 13, 5, ILI9341_BLUE); //Argolla1
tft.drawRoundRect(94, uma, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//8
if (uma == 91) {
tft.fillRoundRect(94, uma, 37, 13, 5, ILI9341_BLUE); //Argolla1
tft.drawRoundRect(94, uma, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//9
if (uma == 78) {
tft.fillRoundRect(94, uma, 37, 13, 5, ILI9341_BLUE); //Argolla1
tft.drawRoundRect(94, uma, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//0
if (uma <= 77) {
//poste en blanco
uma = 195;
tft.fillRect(90, 68, 44, 128, ILI9341_WHITE); //recumadro blanco
tft.fillRect(90, 190, 44, 6, ILI9341_YELLOW); //relleno amarillo
tft.drawLine(90, 190, 140, 190, ILI9341_BLACK);
//Poste Unidades mil
tft.fillRoundRect(108, 70, 8, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(112, 74, 4, ILI9341_BLACK); // Círculo arriba
tft.fillRect(109, 75, 7, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(108, 74, 108, 195, ILI9341_BLACK);
tft.drawLine(116, 74, 116, 195, ILI9341_BLACK);
tft.drawLine(108, 74, 116, 74, ILI9341_BLACK);
}
}
}
decisionPulsador4 = estadoPulsador4;*/
// Decenas de Mil
/*if (estadoPulsador5 != decisionPulsador5) {
delay (50);
if (estadoPulsador5 == HIGH) {
digitalWrite(12, HIGH);
Dm = Dm + 1;
dma = dma - 13;
delay(100);
digitalWrite(12, LOW);
if (Dm > 9) {
Dm = 0;
}
//1
if (dma == 182) {
tft.fillRoundRect(46, dma, 37, 13, 5, ILI9341_CYAN); //Argolla1
tft.drawRoundRect(46, dma, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//2
if (dma == 169) {
tft.fillRoundRect(46, dma, 37, 13, 5, ILI9341_CYAN); //Argolla1
tft.drawRoundRect(46, dma, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//3
if (dma == 156) {
tft.fillRoundRect(46, dma, 37, 13, 5, ILI9341_CYAN); //Argolla1
tft.drawRoundRect(46, dma, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//4
if (dma == 143) {
tft.fillRoundRect(46, dma, 37, 13, 5, ILI9341_CYAN); //Argolla1
tft.drawRoundRect(46, dma, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//5
if (dma == 130) {
tft.fillRoundRect(46, dma, 37, 13, 5, ILI9341_CYAN); //Argolla1
tft.drawRoundRect(46, dma, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//6
if (dma == 117) {
tft.fillRoundRect(46, dma, 37, 13, 5, ILI9341_CYAN); //Argolla1
tft.drawRoundRect(46, dma, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//7
if (dma == 104) {
tft.fillRoundRect(46, dma, 37, 13, 5, ILI9341_CYAN); //Argolla1
tft.drawRoundRect(46, dma, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//8
if (dma == 91) {
tft.fillRoundRect(46, dma, 37, 13, 5, ILI9341_CYAN); //Argolla1
tft.drawRoundRect(46, dma, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//9
if (dma == 78) {
tft.fillRoundRect(46, dma, 37, 13, 5, ILI9341_CYAN); //Argolla1
tft.drawRoundRect(46, dma, 37, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//0
if (dma <= 77) {
//poste en blanco
dma = 195;
tft.fillRect(40, 68, 44, 128, ILI9341_WHITE); //recdmadro blanco
tft.fillRect(40, 190, 44, 6, ILI9341_YELLOW); //relleno amarillo
tft.drawLine(40, 190, 90, 190, ILI9341_BLACK);
//Poste Decenas mil
tft.fillRoundRect(60, 70, 8, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(64, 74, 4, ILI9341_BLACK); // Círculo arriba
tft.fillRect(61, 75, 7, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(60, 74, 60, 195, ILI9341_BLACK);
tft.drawLine(68, 74, 68, 195, ILI9341_BLACK);
tft.drawLine(60, 74, 68, 74, ILI9341_BLACK);
}
}
}
decisionPulsador5 = estadoPulsador5;*/
delay(10);
break;
case 16:
// argollas 6 cifras
R = ((Cm * 100000) + (Dm * 10000) + (Um * 1000) + (C * 100) + (D * 10) + (U * 1));
tft.setTextColor(ILI9341_BLACK, ILI9341_WHITE), tft.setTextSize(3), tft.setCursor(70, 25);
sprintf(bufferString, "mero: %-6d", R);
tft.print(bufferString);
tft.setCursor(34, 25), tft.print("N"), tft.write(0xA3); //ú +18 ancho
// Unidades
if (estadoPulsador1 != decisionPulsador1) {
delay (50);
if (estadoPulsador1 == HIGH) {
digitalWrite(12, HIGH);
U = U + 1;
ua = ua - 13;
delay(100);
digitalWrite(12, LOW);
if (U > 9) {
U = 0;
}
//1
if (ua == 182) {
tft.fillRoundRect(257, ua, 32, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(257, ua, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//2
if (ua == 169) {
tft.fillRoundRect(257, ua, 32, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(257, ua, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//3
if (ua == 156) {
tft.fillRoundRect(257, ua, 32, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(257, ua, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//4
if (ua == 143) {
tft.fillRoundRect(257, ua, 32, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(257, ua, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//5
if (ua == 130) {
tft.fillRoundRect(257, ua, 32, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(257, ua, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//6
if (ua == 117) {
tft.fillRoundRect(257, ua, 32, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(257, ua, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//7
if (ua == 104) {
tft.fillRoundRect(257, ua, 32, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(257, ua, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//8
if (ua == 91) {
tft.fillRoundRect(257, ua, 32, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(257, ua, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//9
if (ua == 78) {
tft.fillRoundRect(257, ua, 32, 13, 5, ILI9341_MAGENTA); //Argolla1
tft.drawRoundRect(257, ua, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//0
if (ua <= 77) {
//poste en blanco
ua = 195;
tft.fillRect(250, 68, 40, 128, ILI9341_WHITE); //recuadro blanco
tft.fillRect(250, 190, 40, 6, ILI9341_YELLOW); //relleno amarillo
tft.drawLine(250, 190, 290, 190, ILI9341_BLACK);
//Poste Unidades
tft.fillRoundRect(268, 70, 8, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(272, 74, 4, ILI9341_BLACK); // Círculo arriba
tft.fillRect(269, 75, 7, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(268, 74, 268, 195, ILI9341_BLACK);
tft.drawLine(276, 74, 276, 195, ILI9341_BLACK);
tft.drawLine(268, 74, 276, 74, ILI9341_BLACK);
}
}
}
decisionPulsador1 = estadoPulsador1;
// Decenas
/*if (estadoPulsador2 != decisionPulsador2) {
delay (50);
if (estadoPulsador2 == HIGH) {
digitalWrite(12, HIGH);
D=D+1;
da = da - 13;
delay(100);
digitalWrite(12, LOW);
if (D>9){
D=0;
}
//1
if (da == 182) {
tft.fillRoundRect(213, da, 32, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(213, da, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//2
if (da == 169) {
tft.fillRoundRect(213, da, 32, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(213, da, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//3
if (da == 156) {
tft.fillRoundRect(213, da, 32, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(213, da, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//4
if (da == 143) {
tft.fillRoundRect(213, da, 32, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(213, da, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//5
if (da == 130) {
tft.fillRoundRect(213, da, 32, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(213, da, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//6
if (da == 117) {
tft.fillRoundRect(213, da, 32, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(213, da, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//7
if (da == 104) {
tft.fillRoundRect(213, da, 32, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(213, da, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//8
if (da == 91) {
tft.fillRoundRect(213, da, 32, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(213, da, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//9
if (da == 78) {
tft.fillRoundRect(213, da, 32, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(213, da, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//0
if (da <= 77) {
//poste en blanco
da = 195;
tft.fillRect(210, 68, 40, 128, ILI9341_WHITE); //recdadro blanco
tft.fillRect(210, 190, 40, 6, ILI9341_YELLOW); //relleno amarillo
tft.drawLine(210, 190, 250, 190, ILI9341_BLACK);
//Poste Decenas
tft.fillRoundRect(224, 70, 8, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(228, 74, 4, ILI9341_BLACK); // Círculo arriba
tft.fillRect(225, 75, 7, 6, ILI9341_YELLOW); //cdadro para tapar círculo
tft.drawLine(224, 74, 224, 195, ILI9341_BLACK);
tft.drawLine(232, 74, 232, 195, ILI9341_BLACK);
tft.drawLine(224, 74, 232, 74, ILI9341_BLACK);
}
}
}
decisionPulsador2 = estadoPulsador2;*/
// Centenas
/*if (estadoPulsador3 != decisionPulsador3) {
delay (50);
if (estadoPulsador3 == HIGH) {
digitalWrite(12, HIGH);
C=C+1;
ca = ca - 13;
delay(100);
digitalWrite(12, LOW);
if(C>9){
C=0;
}
//1
if (ca == 182) {
tft.fillRoundRect(169, ca, 32, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(169, ca, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//2
if (ca == 169) {
tft.fillRoundRect(169, ca, 32, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(169, ca, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//3
if (ca == 156) {
tft.fillRoundRect(169, ca, 32, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(169, ca, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//4
if (ca == 143) {
tft.fillRoundRect(169, ca, 32, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(169, ca, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//5
if (ca == 130) {
tft.fillRoundRect(169, ca, 32, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(169, ca, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//6
if (ca == 117) {
tft.fillRoundRect(169, ca, 32, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(169, ca, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//7
if (ca == 104) {
tft.fillRoundRect(169, ca, 32, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(169, ca, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//8
if (ca == 91) {
tft.fillRoundRect(169, ca, 32, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(169, ca, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//9
if (ca == 78) {
tft.fillRoundRect(169, ca, 32, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(169, ca, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//0
if (ca <= 77) {
//poste en blanco
ca = 195;
tft.fillRect(166, 68, 40, 128, ILI9341_WHITE); //reccadro blanco
tft.fillRect(166, 190, 40, 6, ILI9341_YELLOW); //relleno amarillo
tft.drawLine(166, 190, 208, 190, ILI9341_BLACK);
//Poste Decenas
tft.fillRoundRect(180, 70, 8, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(184, 74, 4, ILI9341_BLACK); // Círculo arriba
tft.fillRect(181, 75, 7, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(180, 74, 180, 195, ILI9341_BLACK);
tft.drawLine(188, 74, 188, 195, ILI9341_BLACK);
tft.drawLine(180, 74, 188, 74, ILI9341_BLACK);
}
}
}
decisionPulsador3 = estadoPulsador3;*/
// Unidades de mil
/*if (estadoPulsador4 != decisionPulsador4) {
delay (50);
if (estadoPulsador4 == HIGH) {
digitalWrite(12, HIGH);
Um=Um+1;
uma = uma - 13;
delay(100);
digitalWrite(12, LOW);
if(Um>9){
Um=0;
}
//1
if (uma == 182) {
tft.fillRoundRect(125, uma, 32, 13, 5, ILI9341_BLUE); //Argolla1
tft.drawRoundRect(125, uma, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//2
if (uma == 169) {
tft.fillRoundRect(125, uma, 32, 13, 5, ILI9341_BLUE); //Argolla1
tft.drawRoundRect(125, uma, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//3
if (uma == 156) {
tft.fillRoundRect(125, uma, 32, 13, 5, ILI9341_BLUE); //Argolla1
tft.drawRoundRect(125, uma, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//4
if (uma == 143) {
tft.fillRoundRect(125, uma, 32, 13, 5, ILI9341_BLUE); //Argolla1
tft.drawRoundRect(125, uma, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//5
if (uma == 130) {
tft.fillRoundRect(125, uma, 32, 13, 5, ILI9341_BLUE); //Argolla1
tft.drawRoundRect(125, uma, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//6
if (uma == 117) {
tft.fillRoundRect(125, uma, 32, 13, 5, ILI9341_BLUE); //Argolla1
tft.drawRoundRect(125, uma, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//7
if (uma == 104) {
tft.fillRoundRect(125, uma, 32, 13, 5, ILI9341_BLUE); //Argolla1
tft.drawRoundRect(125, uma, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//8
if (uma == 91) {
tft.fillRoundRect(125, uma, 32, 13, 5, ILI9341_BLUE); //Argolla1
tft.drawRoundRect(125, uma, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//9
if (uma == 78) {
tft.fillRoundRect(125, uma, 32, 13, 5, ILI9341_BLUE); //Argolla1
tft.drawRoundRect(125, uma, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//0
if (uma <= 77) {
//poste en blanco
uma = 195;
tft.fillRect(121, 68, 40, 128, ILI9341_WHITE); //recumadro blanco
tft.fillRect(121, 190, 40, 6, ILI9341_YELLOW); //relleno amarillo
tft.drawLine(121, 190, 161, 190, ILI9341_BLACK);
//Poste Unidad de mil
tft.fillRoundRect(136, 70, 8, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(140, 74, 4, ILI9341_BLACK); // Círculo arriba
tft.fillRect(137, 75, 7, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(136, 74, 136, 195, ILI9341_BLACK);
tft.drawLine(144, 74, 144, 195, ILI9341_BLACK);
tft.drawLine(136, 74, 144, 74, ILI9341_BLACK);
}
}
}
decisionPulsador4 = estadoPulsador4;*/
// Decenas de mil
/*if (estadoPulsador5 != decisionPulsador5) {
delay (50);
if (estadoPulsador5 == HIGH) {
digitalWrite(12, HIGH);
Dm=Dm+1;
dma = dma - 13;
delay(100);
digitalWrite(12, LOW);
if(Dm>9){
Dm=0;
}
//1
if (dma == 182) {
tft.fillRoundRect(81, dma, 32, 13, 5, ILI9341_CYAN); //Argolla1
tft.drawRoundRect(81, dma, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//2
if (dma == 169) {
tft.fillRoundRect(81, dma, 32, 13, 5, ILI9341_CYAN); //Argolla1
tft.drawRoundRect(81, dma, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//3
if (dma == 156) {
tft.fillRoundRect(81, dma, 32, 13, 5, ILI9341_CYAN); //Argolla1
tft.drawRoundRect(81, dma, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//4
if (dma == 143) {
tft.fillRoundRect(81, dma, 32, 13, 5, ILI9341_CYAN); //Argolla1
tft.drawRoundRect(81, dma, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//5
if (dma == 130) {
tft.fillRoundRect(81, dma, 32, 13, 5, ILI9341_CYAN); //Argolla1
tft.drawRoundRect(81, dma, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//6
if (dma == 117) {
tft.fillRoundRect(81, dma, 32, 13, 5, ILI9341_CYAN); //Argolla1
tft.drawRoundRect(81, dma, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//7
if (dma == 104) {
tft.fillRoundRect(81, dma, 32, 13, 5, ILI9341_CYAN); //Argolla1
tft.drawRoundRect(81, dma, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//8
if (dma == 91) {
tft.fillRoundRect(81, dma, 32, 13, 5, ILI9341_CYAN); //Argolla1
tft.drawRoundRect(81, dma, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//9
if (dma == 78) {
tft.fillRoundRect(81, dma, 32, 13, 5, ILI9341_CYAN); //Argolla1
tft.drawRoundRect(81, dma, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//0
if (dma <= 77) {
//poste en blanco
dma = 195;
tft.fillRect(78, 68, 40, 128, ILI9341_WHITE); //recdmadro blanco
tft.fillRect(78, 190, 40, 6, ILI9341_YELLOW); //relleno amarillo
tft.drawLine(78, 190, 121, 190, ILI9341_BLACK);
//Poste Decena de mil
tft.fillRoundRect(92, 70, 8, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(96, 74, 4, ILI9341_BLACK); // Círculo arriba
tft.fillRect(93, 75, 7, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(92, 74, 92, 195, ILI9341_BLACK);
tft.drawLine(100, 74, 100, 195, ILI9341_BLACK);
tft.drawLine(92, 74, 100, 74, ILI9341_BLACK);
}
}
}
decisionPulsador5 = estadoPulsador5;*/
// Centenas de mil
/*if (estadoPulsador6 != decisionPulsador6) {
delay (50);
if (estadoPulsador6 == HIGH) {
digitalWrite(12, HIGH);
Cm = Cm + 1;
cma = cma - 13;
delay(100);
digitalWrite(12, LOW);
if (Cm > 9) {
Cm = 0;
}
//1
if (cma == 182) {
tft.fillRoundRect(37, cma, 32, 13, 5, ILI9341_WHITE); //Argolla1
tft.drawRoundRect(37, cma, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//2
if (cma == 169) {
tft.fillRoundRect(37, cma, 32, 13, 5, ILI9341_WHITE); //Argolla1
tft.drawRoundRect(37, cma, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//3
if (cma == 156) {
tft.fillRoundRect(37, cma, 32, 13, 5, ILI9341_WHITE); //Argolla1
tft.drawRoundRect(37, cma, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//4
if (cma == 143) {
tft.fillRoundRect(37, cma, 32, 13, 5, ILI9341_WHITE); //Argolla1
tft.drawRoundRect(37, cma, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//5
if (cma == 130) {
tft.fillRoundRect(37, cma, 32, 13, 5, ILI9341_WHITE); //Argolla1
tft.drawRoundRect(37, cma, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//6
if (cma == 117) {
tft.fillRoundRect(37, cma, 32, 13, 5, ILI9341_WHITE); //Argolla1
tft.drawRoundRect(37, cma, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//7
if (cma == 104) {
tft.fillRoundRect(37, cma, 32, 13, 5, ILI9341_WHITE); //Argolla1
tft.drawRoundRect(37, cma, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//8
if (cma == 91) {
tft.fillRoundRect(37, cma, 32, 13, 5, ILI9341_WHITE); //Argolla1
tft.drawRoundRect(37, cma, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//9
if (cma == 78) {
tft.fillRoundRect(37, cma, 32, 13, 5, ILI9341_WHITE); //Argolla1
tft.drawRoundRect(37, cma, 32, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//0
if (cma <= 77) {
//poste en blanco
cma = 195;
tft.fillRect(34, 68, 40, 128, ILI9341_WHITE); //reccmadro blanco
tft.fillRect(34, 190, 40, 6, ILI9341_YELLOW); //relleno amarillo
tft.drawLine(34, 190, 81, 190, ILI9341_BLACK);
//Poste Centenas de mil
tft.fillRoundRect(48, 70, 8, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(52, 74, 4, ILI9341_BLACK); // Círculo arriba
tft.fillRect(49, 75, 7, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(48, 74, 48, 195, ILI9341_BLACK);
tft.drawLine(56, 74, 56, 195, ILI9341_BLACK);
tft.drawLine(48, 74, 56, 74, ILI9341_BLACK);
}
}
}
decisionPulsador6 = estadoPulsador6;*/
delay(10);
break;
case 17:
// argollas 7 cifras
R = ((M * 1000000) + (Cm * 100000) + (Dm * 10000) + (Um * 1000) + (C * 100) + (D * 10) + (U * 1));
tft.setTextColor(ILI9341_BLACK, ILI9341_WHITE), tft.setTextSize(3), tft.setCursor(62, 25);
sprintf(bufferString, "mero: %-7d", R);
tft.print(bufferString);
tft.setCursor(26, 25), tft.print("N"), tft.write(0xA3); //ú +18 ancho
// unidades
if (estadoPulsador1 != decisionPulsador1) {
delay (50);
if (estadoPulsador1 == HIGH) {
digitalWrite(12, HIGH);
U = U + 1;
ua = ua - 13;
delay(100);
digitalWrite(12, LOW);
if (U > 9) {
U = 0;
}
//1
if (ua == 182) {
tft.fillRoundRect(265, ua, 31, 13, 5, ILI9341_YELLOW); //Argolla1
tft.drawRoundRect(265, ua, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//2
if (ua == 169) {
tft.fillRoundRect(265, ua, 31, 13, 5, ILI9341_YELLOW); //Argolla1
tft.drawRoundRect(265, ua, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//3
if (ua == 156) {
tft.fillRoundRect(265, ua, 31, 13, 5, ILI9341_YELLOW); //Argolla1
tft.drawRoundRect(265, ua, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//4
if (ua == 143) {
tft.fillRoundRect(265, ua, 31, 13, 5, ILI9341_YELLOW); //Argolla1
tft.drawRoundRect(265, ua, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//5
if (ua == 130) {
tft.fillRoundRect(265, ua, 31, 13, 5, ILI9341_YELLOW); //Argolla1
tft.drawRoundRect(265, ua, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//6
if (ua == 117) {
tft.fillRoundRect(265, ua, 31, 13, 5, ILI9341_YELLOW); //Argolla1
tft.drawRoundRect(265, ua, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//7
if (ua == 104) {
tft.fillRoundRect(265, ua, 31, 13, 5, ILI9341_YELLOW); //Argolla1
tft.drawRoundRect(265, ua, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//8
if (ua == 91) {
tft.fillRoundRect(265, ua, 31, 13, 5, ILI9341_YELLOW); //Argolla1
tft.drawRoundRect(265, ua, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//9
if (ua == 78) {
tft.fillRoundRect(265, ua, 31, 13, 5, ILI9341_YELLOW); //Argolla1
tft.drawRoundRect(265, ua, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//0
if (ua <= 77) {
//poste en blanco
//poste Decenas
ua = 195;
tft.fillRect(260, 68, 40, 128, ILI9341_WHITE); //recuadro blanco
tft.fillRect(260, 190, 40, 6, ILI9341_YELLOW); //relleno amarillo
tft.fillTriangle(290, 190, 300, 200, 300, 190, ILI9341_WHITE); //Triangulo blanco
tft.drawLine(260, 190, 290, 190, ILI9341_BLACK); //Borde negro
tft.drawLine(290, 190, 300, 200, ILI9341_BLACK); //Borde negro
//Poste Unidad
tft.fillRoundRect(276, 70, 8, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(280, 74, 4, ILI9341_BLACK); // Círculo arriba
tft.fillRect(277, 75, 7, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(276, 74, 276, 195, ILI9341_BLACK);
tft.drawLine(284, 74, 284, 195, ILI9341_BLACK);
tft.drawLine(276, 74, 284, 74, ILI9341_BLACK);
}
}
}
decisionPulsador1 = estadoPulsador1;
// decenas
/*if (estadoPulsador2 != decisionPulsador2) {
delay (50);
if (estadoPulsador2 == HIGH) {
digitalWrite(12, HIGH);
D=D+1;
da = da - 13;
delay(100);
digitalWrite(12, LOW);
if(D>9){
D=0;
}
//1
if (da == 182) {
tft.fillRoundRect(225, da, 31, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(225, da, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//2
if (da == 169) {
tft.fillRoundRect(225, da, 31, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(225, da, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//3
if (da == 156) {
tft.fillRoundRect(225, da, 31, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(225, da, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//4
if (da == 143) {
tft.fillRoundRect(225, da, 31, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(225, da, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//5
if (da == 130) {
tft.fillRoundRect(225, da, 31, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(225, da, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//6
if (da == 117) {
tft.fillRoundRect(225, da, 31, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(225, da, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//7
if (da == 104) {
tft.fillRoundRect(225, da, 31, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(225, da, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//8
if (da == 91) {
tft.fillRoundRect(225, da, 31, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(225, da, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//9
if (da == 78) {
tft.fillRoundRect(225, da, 31, 13, 5, ILI9341_GREEN); //Argolla1
tft.drawRoundRect(225, da, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//0
if (da <= 77) {
//poste en blanco
//poste Decenas
da = 195;
tft.fillRect(220, 68, 40, 128, ILI9341_WHITE); //recuadro blanco
tft.fillRect(220, 190, 40, 6, ILI9341_YELLOW); //relleno amarillo
tft.drawLine(220, 190, 260, 190, ILI9341_BLACK);
tft.fillRoundRect(236, 70, 8, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(240, 74, 4, ILI9341_BLACK); // Círculo arriba
tft.fillRect(237, 75, 7, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(236, 74, 236, 195, ILI9341_BLACK);
tft.drawLine(244, 74, 244, 195, ILI9341_BLACK);
tft.drawLine(236, 74, 244, 74, ILI9341_BLACK);
}
}
}
decisionPulsador2 = estadoPulsador2;*/
// Centenas
/*if (estadoPulsador3 != decisionPulsador3) {
delay (50);
if (estadoPulsador3 == HIGH) {
digitalWrite(12, HIGH);
C=C+1;
ca = ca - 13;
delay(100);
digitalWrite(12, LOW);
if(C>9){
C=0;
}
//1
if (ca == 182) {
tft.fillRoundRect(185, ca, 31, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(185, ca, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//2
if (ca == 169) {
tft.fillRoundRect(185, ca, 31, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(185, ca, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//3
if (ca == 156) {
tft.fillRoundRect(185, ca, 31, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(185, ca, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//4
if (ca == 143) {
tft.fillRoundRect(185, ca, 31, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(185, ca, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//5
if (ca == 130) {
tft.fillRoundRect(185, ca, 31, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(185, ca, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//6
if (ca == 117) {
tft.fillRoundRect(185, ca, 31, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(185, ca, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//7
if (ca == 104) {
tft.fillRoundRect(185, ca, 31, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(185, ca, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//8
if (ca == 91) {
tft.fillRoundRect(185, ca, 31, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(185, ca, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//9
if (ca == 78) {
tft.fillRoundRect(185, ca, 31, 13, 5, ILI9341_RED); //Argolla1
tft.drawRoundRect(185, ca, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//0
if (ca <= 77) {
//poste en blanco
ca = 195;
tft.fillRect(180, 68, 40, 128, ILI9341_WHITE); //recuadro blanco
tft.fillRect(180, 190, 40, 6, ILI9341_YELLOW); //relleno amarillo
tft.drawLine(180, 190, 220, 190, ILI9341_BLACK); //Borde negro
//poste Centenas
tft.fillRoundRect(196, 70, 8, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(200, 74, 4, ILI9341_BLACK); // Círculo arriba
tft.fillRect(197, 75, 7, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(196, 74, 196, 195, ILI9341_BLACK);
tft.drawLine(204, 74, 204, 195, ILI9341_BLACK);
tft.drawLine(196, 74, 204, 74, ILI9341_BLACK);
}
}
}
decisionPulsador3 = estadoPulsador3;*/
//Unidad de mil
/*if (estadoPulsador4 != decisionPulsador4) {
delay (50);
if (estadoPulsador4 == HIGH) {
digitalWrite(12, HIGH);
Um=Um+1;
uma = uma - 13;
delay(100);
digitalWrite(12, LOW);
if(Um>9){
Um=0;
}
//1
if (uma == 182) {
tft.fillRoundRect(145, uma, 31, 13, 5, ILI9341_BLUE); //Argolla1
tft.drawRoundRect(145, uma, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//2
if (uma == 169) {
tft.fillRoundRect(145, uma, 31, 13, 5, ILI9341_BLUE); //Argolla1
tft.drawRoundRect(145, uma, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//3
if (uma == 156) {
tft.fillRoundRect(145, uma, 31, 13, 5, ILI9341_BLUE); //Argolla1
tft.drawRoundRect(145, uma, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//4
if (uma == 143) {
tft.fillRoundRect(145, uma, 31, 13, 5, ILI9341_BLUE); //Argolla1
tft.drawRoundRect(145, uma, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//5
if (uma == 130) {
tft.fillRoundRect(145, uma, 31, 13, 5, ILI9341_BLUE); //Argolla1
tft.drawRoundRect(145, uma, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//6
if (uma == 117) {
tft.fillRoundRect(145, uma, 31, 13, 5, ILI9341_BLUE); //Argolla1
tft.drawRoundRect(145, uma, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//7
if (uma == 104) {
tft.fillRoundRect(145, uma, 31, 13, 5, ILI9341_BLUE); //Argolla1
tft.drawRoundRect(145, uma, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//8
if (uma == 91) {
tft.fillRoundRect(145, uma, 31, 13, 5, ILI9341_BLUE); //Argolla1
tft.drawRoundRect(145, uma, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//9
if (uma == 78) {
tft.fillRoundRect(145, uma, 31, 13, 5, ILI9341_BLUE); //Argolla1
tft.drawRoundRect(145, uma, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//0
if (uma <= 77) {
//poste en blanco
uma = 195;
tft.fillRect(140, 68, 40, 128, ILI9341_WHITE); //recuadro blanco
tft.fillRect(140, 190, 40, 6, ILI9341_YELLOW); //relleno amarillo
tft.drawLine(140, 190, 180, 190, ILI9341_BLACK); //Borde negro
//Poste Unidades de mil
tft.fillRoundRect(156, 70, 8, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(160, 74, 4, ILI9341_BLACK); // Círculo arriba
tft.fillRect(157, 75, 7, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(156, 74, 156, 195, ILI9341_BLACK);
tft.drawLine(164, 74, 164, 195, ILI9341_BLACK);
tft.drawLine(156, 74, 164, 74, ILI9341_BLACK);
}
}
}
decisionPulsador4 = estadoPulsador4;*/
//Decena de mil
/*if (estadoPulsador5 != decisionPulsador5) {
delay (50);
if (estadoPulsador5 == HIGH) {
digitalWrite(12, HIGH);
Dm=Dm+1;
dma = dma - 13;
delay(100);
digitalWrite(12, LOW);
if(Dm>9){
Dm=0;
}
//1
if (dma == 182) {
tft.fillRoundRect(105, dma, 31, 13, 5, ILI9341_YELLOW); //Argolla1
tft.drawRoundRect(105, dma, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//2
if (dma == 169) {
tft.fillRoundRect(105, dma, 31, 13, 5, ILI9341_YELLOW); //Argolla1
tft.drawRoundRect(105, dma, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//3
if (dma == 156) {
tft.fillRoundRect(105, dma, 31, 13, 5, ILI9341_YELLOW); //Argolla1
tft.drawRoundRect(105, dma, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//4
if (dma == 143) {
tft.fillRoundRect(105, dma, 31, 13, 5, ILI9341_YELLOW); //Argolla1
tft.drawRoundRect(105, dma, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//5
if (dma == 130) {
tft.fillRoundRect(105, dma, 31, 13, 5, ILI9341_YELLOW); //Argolla1
tft.drawRoundRect(105, dma, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//6
if (dma == 117) {
tft.fillRoundRect(105, dma, 31, 13, 5, ILI9341_YELLOW); //Argolla1
tft.drawRoundRect(105, dma, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//7
if (dma == 104) {
tft.fillRoundRect(105, dma, 31, 13, 5, ILI9341_YELLOW); //Argolla1
tft.drawRoundRect(105, dma, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//8
if (dma == 91) {
tft.fillRoundRect(105, dma, 31, 13, 5, ILI9341_YELLOW); //Argolla1
tft.drawRoundRect(105, dma, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//9
if (dma == 78) {
tft.fillRoundRect(105, dma, 31, 13, 5, ILI9341_YELLOW); //Argolla1
tft.drawRoundRect(105, dma, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//0
if (dma <= 77) {
//poste en blanco
dma = 195;
tft.fillRect(100, 68, 40, 128, ILI9341_WHITE); //recuadro blanco
tft.fillRect(100, 190, 40, 6, ILI9341_YELLOW); //relleno amarillo
tft.drawLine(100, 190, 140, 190, ILI9341_BLACK); //Borde negro
//Poste Decenas de mil
tft.fillRoundRect(116, 70, 8, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(120, 74, 4, ILI9341_BLACK); // Círculo arriba
tft.fillRect(117, 75, 7, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(116, 74, 116, 195, ILI9341_BLACK);
tft.drawLine(124, 74, 124, 195, ILI9341_BLACK);
tft.drawLine(116, 74, 124, 74, ILI9341_BLACK);
}
}
}
decisionPulsador5 = estadoPulsador5;*/
//Centenas de mil
/*if (estadoPulsador6 != decisionPulsador6) {
delay (50);
if (estadoPulsador6 == HIGH) {
digitalWrite(12, HIGH);
Cm=Cm+1;
cma = cma - 13;
delay(100);
digitalWrite(12, LOW);
if(Cm>9){
Cm=0;
}
//1
if (cma == 182) {
tft.fillRoundRect(65, cma, 31, 13, 5, ILI9341_WHITE); //Argolla1
tft.drawRoundRect(65, cma, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//2
if (cma == 169) {
tft.fillRoundRect(65, cma, 31, 13, 5, ILI9341_WHITE); //Argolla1
tft.drawRoundRect(65, cma, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//3
if (cma == 156) {
tft.fillRoundRect(65, cma, 31, 13, 5, ILI9341_WHITE); //Argolla1
tft.drawRoundRect(65, cma, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//4
if (cma == 143) {
tft.fillRoundRect(65, cma, 31, 13, 5, ILI9341_WHITE); //Argolla1
tft.drawRoundRect(65, cma, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//5
if (cma == 130) {
tft.fillRoundRect(65, cma, 31, 13, 5, ILI9341_WHITE); //Argolla1
tft.drawRoundRect(65, cma, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//6
if (cma == 117) {
tft.fillRoundRect(65, cma, 31, 13, 5, ILI9341_WHITE); //Argolla1
tft.drawRoundRect(65, cma, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//7
if (cma == 104) {
tft.fillRoundRect(65, cma, 31, 13, 5, ILI9341_WHITE); //Argolla1
tft.drawRoundRect(65, cma, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//8
if (cma == 91) {
tft.fillRoundRect(65, cma, 31, 13, 5, ILI9341_WHITE); //Argolla1
tft.drawRoundRect(65, cma, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//9
if (cma == 78) {
tft.fillRoundRect(65, cma, 31, 13, 5, ILI9341_WHITE); //Argolla1
tft.drawRoundRect(65, cma, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//0
if (cma <= 77) {
//poste en blanco
cma = 195;
tft.fillRect(60, 68, 40, 128, ILI9341_WHITE); //recuadro blanco
tft.fillRect(60, 190, 40, 6, ILI9341_YELLOW); //relleno amarillo
tft.drawLine(60, 190, 100, 190, ILI9341_BLACK); //Borde negro
//Poste Decenas de mil
tft.fillRoundRect(76, 70, 8, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(80, 74, 4, ILI9341_BLACK); // Círculo arriba
tft.fillRect(77, 75, 7, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(76, 74, 76, 195, ILI9341_BLACK);
tft.drawLine(84, 74, 84, 195, ILI9341_BLACK);
tft.drawLine(76, 74, 84, 74, ILI9341_BLACK);
}
}
}
decisionPulsador6 = estadoPulsador6;*/
//Millon
/*if (estadoPulsador7 != decisionPulsador7) {
delay (50);
if (estadoPulsador7 == HIGH) {
digitalWrite(12, HIGH);
M = M + 1;
ma = ma - 13;
delay(100);
digitalWrite(12, LOW);
if (M > 9) {
M = 0;
}
//1
if (ma == 182) {
tft.fillRoundRect(25, ma, 31, 13, 5, ILI9341_YELLOW); //Argolla1
tft.drawRoundRect(25, ma, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//2
if (ma == 169) {
tft.fillRoundRect(25, ma, 31, 13, 5, ILI9341_YELLOW); //Argolla1
tft.drawRoundRect(25, ma, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//3
if (ma == 156) {
tft.fillRoundRect(25, ma, 31, 13, 5, ILI9341_YELLOW); //Argolla1
tft.drawRoundRect(25, ma, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//4
if (ma == 143) {
tft.fillRoundRect(25, ma, 31, 13, 5, ILI9341_YELLOW); //Argolla1
tft.drawRoundRect(25, ma, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//5
if (ma == 130) {
tft.fillRoundRect(25, ma, 31, 13, 5, ILI9341_YELLOW); //Argolla1
tft.drawRoundRect(25, ma, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//6
if (ma == 117) {
tft.fillRoundRect(25, ma, 31, 13, 5, ILI9341_YELLOW); //Argolla1
tft.drawRoundRect(25, ma, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//7
if (ma == 104) {
tft.fillRoundRect(25, ma, 31, 13, 5, ILI9341_YELLOW); //Argolla1
tft.drawRoundRect(25, ma, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//8
if (ma == 91) {
tft.fillRoundRect(25, ma, 31, 13, 5, ILI9341_YELLOW); //Argolla1
tft.drawRoundRect(25, ma, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//9
if (ma == 78) {
tft.fillRoundRect(25, ma, 31, 13, 5, ILI9341_YELLOW); //Argolla1
tft.drawRoundRect(25, ma, 31, 13, 5, ILI9341_BLACK); //ContornoArgolla
}
//0
if (ma <= 77) {
//poste en blanco
ma = 195;
tft.fillRect(20, 68, 40, 128, ILI9341_WHITE); //recuadro blanco
tft.fillRect(20, 190, 40, 6, ILI9341_YELLOW); //relleno amarillo
tft.fillTriangle(30, 190, 20, 200, 20, 190, ILI9341_WHITE); //Triangulo blanco
tft.drawLine(30, 190, 60, 190, ILI9341_BLACK); //Borde negro
tft.drawLine(30, 190, 20, 200, ILI9341_BLACK); //Borde negro
//Poste Decenas de mil
tft.fillRoundRect(36, 70, 8, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(40, 74, 4, ILI9341_BLACK); // Círculo arriba
tft.fillRect(37, 75, 7, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(36, 74, 36, 195, ILI9341_BLACK);
tft.drawLine(44, 74, 44, 195, ILI9341_BLACK);
tft.drawLine(36, 74, 44, 74, ILI9341_BLACK);
}
}
}
decisionPulsador7 = estadoPulsador7;*/
delay(10);
break;
case 22:
// Random argollas 2 cifras
R = ((D * 10) + (U * 1));
tft.setTextColor(ILI9341_BLACK, ILI9341_WHITE), tft.setTextSize(3), tft.setCursor(106, 25);
sprintf(bufferString, "mero: %-2d", Rd);
tft.print(bufferString);
tft.setCursor(70, 25), tft.print("N"), tft.write(0xA3); //ú +18 ancho
// Vida
tft.setTextColor(ILI9341_RED, ILI9341_WHITE), tft.setTextSize(2), tft.setCursor(280, 2);
tft.write(0x03); //
tft.setTextColor(ILI9341_BLACK, ILI9341_WHITE), tft.setCursor(292, 2), tft.print(":");
tft.setCursor(304, 2), tft.print(V);
// Acierto
tft.setTextColor(ILI9341_GREEN, ILI9341_WHITE), tft.setTextSize(2), tft.setCursor(280, 18);
tft.write(0x02); //
tft.setTextColor(ILI9341_BLACK, ILI9341_WHITE), tft.setCursor(292, 18), tft.print(":");
tft.setCursor(304, 18), tft.print(Rs);
/*Serial.print("V: ");
Serial.println(V);
Serial.print("Rs: ");
Serial.println(Rs);*/
if (estadoPulsador3 == HIGH) {
delay(50);
if (estadoPulsador3 == HIGH) {
if (R == Rd) {
Serial.print("V: ");
Serial.println(V);
Serial.print("Rs: ");
Serial.println(Rs);
Rs = Rs + 1;
U = 0, ua = 195, D = 0, da = 195;
etapa = 0;
} else {
Serial.print("V: ");
Serial.println(V);
Serial.print("Rs: ");
Serial.println(Rs);
V = V - 1;
U = 0, ua = 195, D = 0, da = 195;
etapa = 0;
}
}
}
// Unidades
if (estadoPulsador1 != decisionPulsador1) {
delay (50);
if (estadoPulsador1 == HIGH) {
digitalWrite(12, HIGH);
U = U + 1;
ua = ua - 13;
delay(100);
digitalWrite(12, LOW);
if ( U > 9) {
U = 0;
}
//1
if (ua == 182) {
tft.fillRoundRect(170, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla
tft.drawRoundRect(170, ua, 40, 13, 5, ILI9341_BLACK);
}
//2
if (ua == 169) {
tft.fillRoundRect(170, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla
tft.drawRoundRect(170, ua, 40, 13, 5, ILI9341_BLACK);
}
//3
if (ua == 156) {
tft.fillRoundRect(170, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla
tft.drawRoundRect(170, ua, 40, 13, 5, ILI9341_BLACK);
}
//4
if (ua == 143) {
tft.fillRoundRect(170, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla
tft.drawRoundRect(170, ua, 40, 13, 5, ILI9341_BLACK);
}
//5
if (ua == 130) {
tft.fillRoundRect(170, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla
tft.drawRoundRect(170, ua, 40, 13, 5, ILI9341_BLACK);
}
//6
if (ua == 117) {
tft.fillRoundRect(170, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla
tft.drawRoundRect(170, ua, 40, 13, 5, ILI9341_BLACK);
}
//7
if (ua == 104) {
tft.fillRoundRect(170, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla
tft.drawRoundRect(170, ua, 40, 13, 5, ILI9341_BLACK);
}
//8
if (ua == 91) {
tft.fillRoundRect(170, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla
tft.drawRoundRect(170, ua, 40, 13, 5, ILI9341_BLACK);
}
//9
if (ua == 78) {
tft.fillRoundRect(170, ua, 40, 13, 5, ILI9341_MAGENTA); //Argolla
tft.drawRoundRect(170, ua, 40, 13, 5, ILI9341_BLACK);
}
//0
if (ua <= 77) {
//poste en blanco
ua = 195;
tft.fillRect(165, 68, 50, 128, ILI9341_WHITE); //recuadro blanco
tft.fillRect(165, 190, 50, 6, ILI9341_YELLOW); //relleno amarillo
tft.drawLine(165, 190, 215, 190, ILI9341_BLACK);
//Poste Unidades
tft.fillRoundRect(185, 70, 10, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(190, 74, 5, ILI9341_BLACK); // Círculo arriba
tft.fillRect(186, 75, 9, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(185, 74, 185, 195, ILI9341_BLACK);
tft.drawLine(195, 74, 195, 195, ILI9341_BLACK);
tft.drawLine(185, 74, 195, 74, ILI9341_BLACK);
}
}
}
decisionPulsador1 = estadoPulsador1;
// Decenas
if (estadoPulsador2 != decisionPulsador2) {
delay (50);
if (estadoPulsador2 == HIGH) {
digitalWrite(12, HIGH);
D = D + 1;
da = da - 13;
delay(100);
digitalWrite(12, LOW);
if (D > 9) {
D = 0;
}
//1
if (da == 182) {
tft.fillRoundRect(110, da, 40, 13, 5, ILI9341_GREEN); //Argolla
tft.drawRoundRect(110, da, 40, 13, 5, ILI9341_BLACK);
}
//2
if (da == 169) {
tft.fillRoundRect(110, da, 40, 13, 5, ILI9341_GREEN); //Argolla
tft.drawRoundRect(110, da, 40, 13, 5, ILI9341_BLACK);
}
//3
if (da == 156) {
tft.fillRoundRect(110, da, 40, 13, 5, ILI9341_GREEN); //Argolla
tft.drawRoundRect(110, da, 40, 13, 5, ILI9341_BLACK);
}
//4
if (da == 143) {
tft.fillRoundRect(110, da, 40, 13, 5, ILI9341_GREEN); //Argolla
tft.drawRoundRect(110, da, 40, 13, 5, ILI9341_BLACK);
}
//5
if (da == 130) {
tft.fillRoundRect(110, da, 40, 13, 5, ILI9341_GREEN); //Argolla
tft.drawRoundRect(110, da, 40, 13, 5, ILI9341_BLACK);
}
//6
if (da == 117) {
tft.fillRoundRect(110, da, 40, 13, 5, ILI9341_GREEN); //Argolla
tft.drawRoundRect(110, da, 40, 13, 5, ILI9341_BLACK);
}
//7
if (da == 104) {
tft.fillRoundRect(110, da, 40, 13, 5, ILI9341_GREEN); //Argolla
tft.drawRoundRect(110, da, 40, 13, 5, ILI9341_BLACK);
}
//8
if (da == 91) {
tft.fillRoundRect(110, da, 40, 13, 5, ILI9341_GREEN); //Argolla
tft.drawRoundRect(110, da, 40, 13, 5, ILI9341_BLACK);
}
//9
if (da == 78) {
tft.fillRoundRect(110, da, 40, 13, 5, ILI9341_GREEN); //Argolla
tft.drawRoundRect(110, da, 40, 13, 5, ILI9341_BLACK);
}
//0
if (da <= 77) {
//poste en blanco
da = 195;
tft.fillRect(105, 68, 50, 128, ILI9341_WHITE); //recdadro blanco
tft.fillRect(105, 190, 50, 6, ILI9341_YELLOW); //relleno amarillo
tft.drawLine(105, 190, 155, 190, ILI9341_BLACK);
//Poste Decenas
tft.fillRoundRect(125, 70, 10, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(130, 74, 5, ILI9341_BLACK); // Círculo arriba
tft.fillRect(126, 75, 9, 6, ILI9341_YELLOW); //cdadro para tapar círculo
tft.drawLine(125, 74, 125, 195, ILI9341_BLACK);
tft.drawLine(135, 74, 135, 195, ILI9341_BLACK);
tft.drawLine(125, 74, 135, 74, ILI9341_BLACK);
}
}
}
decisionPulsador2 = estadoPulsador2;
delay(10);
break;
}
}
void base1() {
//Una cifra
tft.fillRect(130, 190, 60, 10, ILI9341_YELLOW);
tft.fillRect(120, 200, 80, 20, ILI9341_YELLOW);
tft.fillTriangle(130, 190, 120, 200, 130, 200, ILI9341_YELLOW);
tft.fillTriangle(190, 190, 190, 200, 200, 200, ILI9341_YELLOW);
tft.drawRect(120, 200, 81, 20, ILI9341_BLACK);
tft.drawLine(130, 190, 190, 190, ILI9341_BLACK);
tft.drawLine(130, 190, 120, 200, ILI9341_BLACK);
tft.drawLine(190, 190, 200, 200, ILI9341_BLACK);
tft.setCursor(156, 222), tft.setTextColor(ILI9341_BLACK), tft.setTextSize(2), tft.println("U");
//Poste Unidad
tft.fillRoundRect(155, 70, 10, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(160, 74, 5, ILI9341_BLACK); // Círculo arriba
tft.fillRect(156, 75, 9, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(155, 74, 155, 195, ILI9341_BLACK);
tft.drawLine(165, 74, 165, 195, ILI9341_BLACK);
tft.drawLine(155, 74, 165, 74, ILI9341_BLACK);
//Botones adelante, atras
tft.setTextColor(ILI9341_BLACK, ILI9341_WHITE);
tft.fillCircle(12, 120, 5, ILI9341_CYAN); // Círculo atras
tft.drawCircle(12, 120, 5, ILI9341_BLACK); // Círculo borde
tft.setCursor(7, 130), tft.write(0x11); //<-
tft.fillCircle(308, 120, 5, ILI9341_MAGENTA); // Círculo adelante
tft.drawCircle(308, 120, 5, ILI9341_BLACK); // Círculo borde
tft.setCursor(303, 130), tft.write(0x10); //->
}
void base2() {
//Dos cifras
tft.fillRect(100, 190, 120, 10, ILI9341_YELLOW);
tft.fillRect(90, 200, 140, 20, ILI9341_YELLOW);
tft.fillTriangle(100, 190, 90, 200, 100, 200, ILI9341_YELLOW);
tft.fillTriangle(220, 190, 220, 200, 230, 200, ILI9341_YELLOW);
tft.drawRect(90, 200, 141, 20, ILI9341_BLACK);
tft.drawLine(100, 190, 220, 190, ILI9341_BLACK);
tft.drawLine(100, 190, 90, 200, ILI9341_BLACK);
tft.drawLine(220, 190, 230, 200, ILI9341_BLACK);
tft.setCursor(186, 222), tft.setTextColor(ILI9341_BLACK), tft.setTextSize(2), tft.println("U");
tft.setCursor(126, 222), tft.setTextColor(ILI9341_BLACK), tft.setTextSize(2), tft.println("D");
//Poste Unidad
tft.fillRoundRect(185, 70, 10, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(190, 74, 5, ILI9341_BLACK); // Círculo arriba
tft.fillRect(186, 75, 9, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(185, 74, 185, 195, ILI9341_BLACK);
tft.drawLine(195, 74, 195, 195, ILI9341_BLACK);
tft.drawLine(185, 74, 195, 74, ILI9341_BLACK);
//Poste Decena
tft.fillRoundRect(125, 70, 10, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(130, 74, 5, ILI9341_BLACK); // Círculo arriba
tft.fillRect(126, 75, 9, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(125, 74, 125, 195, ILI9341_BLACK);
tft.drawLine(135, 74, 135, 195, ILI9341_BLACK);
tft.drawLine(125, 74, 135, 74, ILI9341_BLACK);
//Botones adelante, atras
tft.setTextColor(ILI9341_BLACK, ILI9341_WHITE);
tft.fillCircle(12, 120, 5, ILI9341_CYAN); // Círculo atras
tft.drawCircle(12, 120, 5, ILI9341_BLACK); // Círculo borde
tft.setCursor(7, 130), tft.write(0x11); //<-
tft.fillCircle(308, 120, 5, ILI9341_MAGENTA); // Círculo adelante
tft.drawCircle(308, 120, 5, ILI9341_BLACK); // Círculo borde
tft.setCursor(303, 130), tft.write(0x10); //->
}
void base3() {
//Tres Cifras
//Base ábaco
tft.fillRect(70, 190, 180, 10, ILI9341_YELLOW);
tft.fillRect(60, 200, 200, 20, ILI9341_YELLOW);
tft.fillTriangle(70, 190, 60, 200, 70, 200, ILI9341_YELLOW);
tft.fillTriangle(250, 190, 250, 200, 260, 200, ILI9341_YELLOW);
tft.drawRect(60, 200, 201, 20, ILI9341_BLACK);
tft.drawLine(70, 190, 250, 190, ILI9341_BLACK);
tft.drawLine(70, 190, 60, 200, ILI9341_BLACK);
tft.drawLine(250, 190, 260, 200, ILI9341_BLACK);
tft.setCursor(216, 222), tft.setTextColor(ILI9341_BLACK), tft.setTextSize(2), tft.println("U");
tft.setCursor(156, 222), tft.setTextColor(ILI9341_BLACK), tft.setTextSize(2), tft.println("D");
tft.setCursor(96, 222), tft.setTextColor(ILI9341_BLACK), tft.setTextSize(2), tft.println("C");
//Poste Unidades
tft.fillRoundRect(215, 70, 10, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(220, 74, 5, ILI9341_BLACK); // Círculo arriba
tft.fillRect(216, 75, 9, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(215, 74, 215, 195, ILI9341_BLACK);
tft.drawLine(225, 74, 225, 195, ILI9341_BLACK);
tft.drawLine(215, 74, 225, 74, ILI9341_BLACK);
//Poste Decenas
tft.fillRoundRect(155, 70, 10, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(160, 74, 5, ILI9341_BLACK); // Círculo arriba
tft.fillRect(156, 75, 9, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(155, 74, 155, 195, ILI9341_BLACK);
tft.drawLine(165, 74, 165, 195, ILI9341_BLACK);
tft.drawLine(155, 74, 165, 74, ILI9341_BLACK);
//Poste Cenetenas
tft.fillRoundRect(95, 70, 10, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(100, 74, 5, ILI9341_BLACK); // Círculo arriba
tft.fillRect(96, 75, 9, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(95, 74, 95, 195, ILI9341_BLACK);
tft.drawLine(105, 74, 105, 195, ILI9341_BLACK);
tft.drawLine(95, 74, 105, 74, ILI9341_BLACK);
//Botones adelante, atras
tft.setTextColor(ILI9341_BLACK, ILI9341_WHITE);
tft.fillCircle(12, 120, 5, ILI9341_CYAN); // Círculo atras
tft.drawCircle(12, 120, 5, ILI9341_BLACK); // Círculo borde
tft.setCursor(7, 130), tft.write(0x11); //<-
tft.fillCircle(308, 120, 5, ILI9341_MAGENTA); // Círculo adelante
tft.drawCircle(308, 120, 5, ILI9341_BLACK); // Círculo borde
tft.setCursor(303, 130), tft.write(0x10); //->
}
void base4 () {
//Base 4 ábaco
tft.fillRect(20, 200, 280, 20, ILI9341_YELLOW);
tft.fillRect(30, 190, 260, 10, ILI9341_YELLOW );
tft.fillTriangle(20, 200, 30, 190, 30, 200, ILI9341_YELLOW);
tft.fillTriangle(290, 190, 290, 200, 300, 200, ILI9341_YELLOW);
tft.drawRect(20, 200, 281, 20, ILI9341_BLACK);
tft.drawLine(30, 190, 290, 190, ILI9341_BLACK);
tft.drawLine(290, 190, 300, 200, ILI9341_BLACK);
tft.drawLine(20, 200, 30, 190, ILI9341_BLACK);
tft.drawLine(20, 200, 300, 200, ILI9341_BLACK);
tft.setCursor(256, 222), tft.setTextColor(ILI9341_BLACK), tft.setTextSize(2), tft.println("U");
tft.setCursor(191, 222), tft.setTextColor(ILI9341_BLACK), tft.setTextSize(2), tft.println("D");
tft.setCursor(121, 222), tft.setTextColor(ILI9341_BLACK), tft.setTextSize(2), tft.println("C");
tft.setCursor(51, 222), tft.setTextColor(ILI9341_BLACK), tft.setTextSize(2), tft.println("Um");
//Poste Unidad
tft.fillRoundRect(255, 70, 10, 125, 4, ILI9341_YELLOW);
tft.drawCircle(260, 74, 5, ILI9341_BLACK); // Círculo arriba
tft.fillRect(256, 75, 9, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(255, 74, 255, 195, ILI9341_BLACK);
tft.drawLine(265, 74, 265, 195, ILI9341_BLACK);
tft.drawLine(255, 74, 265, 74, ILI9341_BLACK);
//Poste Decenas
tft.fillRoundRect(190, 70, 10, 125, 4, ILI9341_YELLOW);
tft.drawCircle(195, 74, 5, ILI9341_BLACK); // Círculo arriba
tft.fillRect(191, 75, 9, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(190, 74, 190, 195, ILI9341_BLACK);
tft.drawLine(200, 74, 200, 195, ILI9341_BLACK);
tft.drawLine(190, 74, 200, 74, ILI9341_BLACK);
//Poste Cenetenas
tft.fillRoundRect(120, 70, 10, 125, 4, ILI9341_YELLOW);
tft.drawCircle(125, 74, 5, ILI9341_BLACK); // Círculo arriba
tft.fillRect(121, 75, 9, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(120, 74, 120, 195, ILI9341_BLACK);
tft.drawLine(130, 74, 130, 195, ILI9341_BLACK);
tft.drawLine(120, 74, 130, 74, ILI9341_BLACK);
//Poste Unidad de Mil
tft.fillRoundRect(55, 70, 10, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(60, 74, 5, ILI9341_BLACK); // Círculo arriba
tft.fillRect(56, 75, 9, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(55, 74, 55, 195, ILI9341_BLACK);
tft.drawLine(65, 74, 65, 195, ILI9341_BLACK);
tft.drawLine(55, 74, 65, 74, ILI9341_BLACK);
//Botones adelante, atras
tft.setTextColor(ILI9341_BLACK, ILI9341_WHITE);
tft.fillCircle(12, 120, 5, ILI9341_CYAN); // Círculo atras
tft.drawCircle(12, 120, 5, ILI9341_BLACK); // Círculo borde
tft.setCursor(7, 130), tft.write(0x11); //<-
tft.fillCircle(308, 120, 5, ILI9341_MAGENTA); // Círculo adelante
tft.drawCircle(308, 120, 5, ILI9341_BLACK); // Círculo borde
tft.setCursor(303, 130), tft.write(0x10); //->
}
void base5() {
tft.fillRect(20, 200, 280, 20, ILI9341_YELLOW);
tft.fillRect(30, 190, 260, 10, ILI9341_YELLOW );
tft.fillTriangle(20, 200, 30, 190, 30, 200, ILI9341_YELLOW);
tft.fillTriangle(290, 190, 290, 200, 300, 200, ILI9341_YELLOW);
tft.drawRect(20, 200, 281, 20, ILI9341_BLACK);
tft.drawLine(30, 190, 290, 190, ILI9341_BLACK);
tft.drawLine(290, 190, 300, 200, ILI9341_BLACK);
tft.drawLine(20, 200, 30, 190, ILI9341_BLACK);
tft.drawLine(20, 200, 300, 200, ILI9341_BLACK);
tft.setCursor(253, 222), tft.setTextColor(ILI9341_BLACK), tft.setTextSize(2), tft.println("U");
tft.setCursor(205, 222), tft.setTextColor(ILI9341_BLACK), tft.setTextSize(2), tft.println("D");
tft.setCursor(157, 222), tft.setTextColor(ILI9341_BLACK), tft.setTextSize(2), tft.println("C");
tft.setCursor(104, 222), tft.setTextColor(ILI9341_BLACK), tft.setTextSize(2), tft.println("Um");
tft.setCursor(56, 222), tft.setTextColor(ILI9341_BLACK), tft.setTextSize(2), tft.println("Dm");
//poste Unidad
tft.fillRoundRect(252, 70, 8, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(256, 74, 4, ILI9341_BLACK); // Círculo arriba
tft.fillRect(253, 75, 7, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(252, 74, 252, 195, ILI9341_BLACK);
tft.drawLine(260, 74, 260, 195, ILI9341_BLACK);
tft.drawLine(252, 74, 260, 74, ILI9341_BLACK);
//poste Decena
tft.fillRoundRect(204, 70, 8, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(208, 74, 4, ILI9341_BLACK); // Círculo arriba
tft.fillRect(205, 75, 7, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(204, 74, 204, 195, ILI9341_BLACK);
tft.drawLine(212, 74, 212, 195, ILI9341_BLACK);
tft.drawLine(204, 74, 212, 74, ILI9341_BLACK);
//poste Centena
tft.fillRoundRect(156, 70, 8, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(160, 74, 4, ILI9341_BLACK); // Círculo arriba
tft.fillRect(157, 75, 7, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(156, 74, 156, 195, ILI9341_BLACK);
tft.drawLine(164, 74, 164, 195, ILI9341_BLACK);
tft.drawLine(156, 74, 164, 74, ILI9341_BLACK);
//poste Unidad de Mil
tft.fillRoundRect(108, 70, 8, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(112, 74, 4, ILI9341_BLACK); // Círculo arriba
tft.fillRect(109, 75, 7, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(108, 74, 108, 195, ILI9341_BLACK);
tft.drawLine(116, 74, 116, 195, ILI9341_BLACK);
tft.drawLine(108, 74, 116, 74, ILI9341_BLACK);
//poste Decenas de Mil
tft.fillRoundRect(60, 70, 8, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(64, 74, 4, ILI9341_BLACK); // Círculo arriba
tft.fillRect(61, 75, 7, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(60, 74, 60, 195, ILI9341_BLACK);
tft.drawLine(68, 74, 68, 195, ILI9341_BLACK);
tft.drawLine(60, 74, 68, 74, ILI9341_BLACK);
//Botones adelante, atras
tft.setTextColor(ILI9341_BLACK, ILI9341_WHITE);
tft.fillCircle(12, 120, 5, ILI9341_CYAN); // Círculo atras
tft.drawCircle(12, 120, 5, ILI9341_BLACK); // Círculo borde
tft.setCursor(7, 130), tft.write(0x11); //<-
tft.fillCircle(308, 120, 5, ILI9341_MAGENTA); // Círculo adelante
tft.drawCircle(308, 120, 5, ILI9341_BLACK); // Círculo borde
tft.setCursor(303, 130), tft.write(0x10); //->
}
void base6() {
tft.fillRect(20, 200, 280, 20, ILI9341_YELLOW);
tft.fillRect(30, 190, 260, 10, ILI9341_YELLOW );
tft.fillTriangle(20, 200, 30, 190, 30, 200, ILI9341_YELLOW);
tft.fillTriangle(290, 190, 290, 200, 300, 200, ILI9341_YELLOW);
tft.drawRect(20, 200, 281, 20, ILI9341_BLACK);
tft.drawLine(30, 190, 290, 190, ILI9341_BLACK);
tft.drawLine(290, 190, 300, 200, ILI9341_BLACK);
tft.drawLine(20, 200, 30, 190, ILI9341_BLACK);
tft.drawLine(20, 200, 300, 200, ILI9341_BLACK);
tft.setCursor(269, 222), tft.setTextColor(ILI9341_BLACK), tft.setTextSize(2), tft.println("U");
tft.setCursor(225, 222), tft.setTextColor(ILI9341_BLACK), tft.setTextSize(2), tft.println("D");
tft.setCursor(181, 222), tft.setTextColor(ILI9341_BLACK), tft.setTextSize(2), tft.println("C");
tft.setCursor(132, 222), tft.setTextColor(ILI9341_BLACK), tft.setTextSize(2), tft.println("Um");
tft.setCursor(88, 222), tft.setTextColor(ILI9341_BLACK), tft.setTextSize(2), tft.println("Dm");
tft.setCursor(44, 222), tft.setTextColor(ILI9341_BLACK), tft.setTextSize(2), tft.println("Cm");
//poste Unidad
tft.fillRoundRect(268, 70, 8, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(272, 74, 4, ILI9341_BLACK); // Círculo arriba
tft.fillRect(269, 75, 7, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(268, 74, 268, 195, ILI9341_BLACK);
tft.drawLine(276, 74, 276, 195, ILI9341_BLACK);
tft.drawLine(268, 74, 276, 74, ILI9341_BLACK);
//poste Decena
tft.fillRoundRect(224, 70, 8, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(228, 74, 4, ILI9341_BLACK); // Círculo arriba
tft.fillRect(225, 75, 7, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(224, 74, 224, 195, ILI9341_BLACK);
tft.drawLine(232, 74, 232, 195, ILI9341_BLACK);
tft.drawLine(224, 74, 232, 74, ILI9341_BLACK);
//poste Centena
tft.fillRoundRect(180, 70, 8, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(184, 74, 4, ILI9341_BLACK); // Círculo arriba
tft.fillRect(181, 75, 7, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(180, 74, 180, 195, ILI9341_BLACK);
tft.drawLine(188, 74, 188, 195, ILI9341_BLACK);
tft.drawLine(180, 74, 188, 74, ILI9341_BLACK);
//poste unidad de mil
tft.fillRoundRect(136, 70, 8, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(140, 74, 4, ILI9341_BLACK); // Círculo arriba
tft.fillRect(137, 75, 7, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(136, 74, 136, 195, ILI9341_BLACK);
tft.drawLine(144, 74, 144, 195, ILI9341_BLACK);
tft.drawLine(136, 74, 144, 74, ILI9341_BLACK);
//poste Decena de mil
tft.fillRoundRect(92, 70, 8, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(96, 74, 4, ILI9341_BLACK); // Círculo arriba
tft.fillRect(93, 75, 7, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(92, 74, 92, 195, ILI9341_BLACK);
tft.drawLine(100, 74, 100, 195, ILI9341_BLACK);
tft.drawLine(92, 74, 100, 74, ILI9341_BLACK);
//poste Centena de mil
tft.fillRoundRect(48, 70, 8, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(52, 74, 4, ILI9341_BLACK); // Círculo arriba
tft.fillRect(49, 75, 7, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(48, 74, 48, 195, ILI9341_BLACK);
tft.drawLine(56, 74, 56, 195, ILI9341_BLACK);
tft.drawLine(48, 74, 56, 74, ILI9341_BLACK);
//Botones adelante, atras
tft.setTextColor(ILI9341_BLACK, ILI9341_WHITE);
tft.fillCircle(12, 120, 5, ILI9341_CYAN); // Círculo atras
tft.drawCircle(12, 120, 5, ILI9341_BLACK); // Círculo borde
tft.setCursor(7, 130), tft.write(0x11); //<-
tft.fillCircle(308, 120, 5, ILI9341_MAGENTA); // Círculo adelante
tft.drawCircle(308, 120, 5, ILI9341_BLACK); // Círculo borde
tft.setCursor(303, 130), tft.write(0x10); //->
}
void base7() {
tft.fillRect(20, 200, 280, 20, ILI9341_YELLOW);
tft.fillRect(30, 190, 260, 10, ILI9341_YELLOW );
tft.fillTriangle(20, 200, 30, 190, 30, 200, ILI9341_YELLOW);
tft.fillTriangle(290, 190, 290, 200, 300, 200, ILI9341_YELLOW);
tft.drawRect(20, 200, 281, 20, ILI9341_BLACK);
tft.drawLine(30, 190, 290, 190, ILI9341_BLACK);
tft.drawLine(290, 190, 300, 200, ILI9341_BLACK);
tft.drawLine(20, 200, 30, 190, ILI9341_BLACK);
tft.drawLine(20, 200, 300, 200, ILI9341_BLACK);
tft.setCursor(277, 222), tft.setTextColor(ILI9341_BLACK), tft.setTextSize(2), tft.println("U");
tft.setCursor(237, 222), tft.setTextColor(ILI9341_BLACK), tft.setTextSize(2), tft.println("D");
tft.setCursor(197, 222), tft.setTextColor(ILI9341_BLACK), tft.setTextSize(2), tft.println("C");
tft.setCursor(152, 222), tft.setTextColor(ILI9341_BLACK), tft.setTextSize(2), tft.println("Um");
tft.setCursor(112, 222), tft.setTextColor(ILI9341_BLACK), tft.setTextSize(2), tft.println("Dm");
tft.setCursor(72, 222), tft.setTextColor(ILI9341_BLACK), tft.setTextSize(2), tft.println("Cm");
tft.setCursor(37, 222), tft.setTextColor(ILI9341_BLACK), tft.setTextSize(2), tft.println("M");
//poste Unidades
tft.fillRoundRect(276, 70, 8, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(280, 74, 4, ILI9341_BLACK); // Círculo arriba
tft.fillRect(277, 75, 7, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(276, 74, 276, 195, ILI9341_BLACK);
tft.drawLine(284, 74, 284, 195, ILI9341_BLACK);
tft.drawLine(276, 74, 284, 74, ILI9341_BLACK);
//poste Decenas
tft.fillRoundRect(236, 70, 8, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(240, 74, 4, ILI9341_BLACK); // Círculo arriba
tft.fillRect(237, 75, 7, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(236, 74, 236, 195, ILI9341_BLACK);
tft.drawLine(244, 74, 244, 195, ILI9341_BLACK);
tft.drawLine(236, 74, 244, 74, ILI9341_BLACK);
//poste Centenas
tft.fillRoundRect(196, 70, 8, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(200, 74, 4, ILI9341_BLACK); // Círculo arriba
tft.fillRect(197, 75, 7, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(196, 74, 196, 195, ILI9341_BLACK);
tft.drawLine(204, 74, 204, 195, ILI9341_BLACK);
tft.drawLine(196, 74, 204, 74, ILI9341_BLACK);
//poste Unidades de mil
tft.fillRoundRect(156, 70, 8, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(160, 74, 4, ILI9341_BLACK); // Círculo arriba
tft.fillRect(157, 75, 7, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(156, 74, 156, 195, ILI9341_BLACK);
tft.drawLine(164, 74, 164, 195, ILI9341_BLACK);
tft.drawLine(156, 74, 164, 74, ILI9341_BLACK);
//poste Decenas de mil
tft.fillRoundRect(116, 70, 8, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(120, 74, 4, ILI9341_BLACK); // Círculo arriba
tft.fillRect(117, 75, 7, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(116, 74, 116, 195, ILI9341_BLACK);
tft.drawLine(124, 74, 124, 195, ILI9341_BLACK);
tft.drawLine(116, 74, 124, 74, ILI9341_BLACK);
//poste Centenas de mil
tft.fillRoundRect(76, 70, 8, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(80, 74, 4, ILI9341_BLACK); // Círculo arriba
tft.fillRect(77, 75, 7, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(76, 74, 76, 195, ILI9341_BLACK);
tft.drawLine(84, 74, 84, 195, ILI9341_BLACK);
tft.drawLine(76, 74, 84, 74, ILI9341_BLACK);
//poste Unidad de millon
tft.fillRoundRect(36, 70, 8, 125, 4, ILI9341_YELLOW); //Rectangulo con curva
tft.drawCircle(40, 74, 4, ILI9341_BLACK); // Círculo arriba
tft.fillRect(37, 75, 7, 6, ILI9341_YELLOW); //cuadro para tapar círculo
tft.drawLine(36, 74, 36, 195, ILI9341_BLACK);
tft.drawLine(44, 74, 44, 195, ILI9341_BLACK);
tft.drawLine(36, 74, 44, 74, ILI9341_BLACK);
//Botones adelante, atras
tft.setTextColor(ILI9341_BLACK, ILI9341_WHITE);
tft.fillCircle(12, 120, 5, ILI9341_CYAN); // Círculo atras
tft.drawCircle(12, 120, 5, ILI9341_BLACK); // Círculo borde
tft.setCursor(7, 130), tft.write(0x11); //<-
tft.fillCircle(308, 120, 5, ILI9341_MAGENTA); // Círculo adelante
tft.drawCircle(308, 120, 5, ILI9341_BLACK); // Círculo borde
tft.setCursor(303, 130), tft.write(0x10); //->
}