Hi arduino due I have designed the counter on the tft screen but I want to make a button controlled counter but I can not find the necessary codes I use ILI9481 Mcu. I need help for button controlled.Thanks everyone
#include <UTFT.h>
extern uint8_t BigFont[];
extern uint8_t SevenSegNumFont[];
UTFT myGLCD(ILI9481, 38, 39, 40, 41);
char printout[4];
int counter = 0;
const int but = 6;
void setup()
{
randomSeed(analogRead(0));
myGLCD.InitLCD();
myGLCD.setFont(BigFont);
pinMode(but, INPUT);
myGLCD.setBackColor(0, 255, 255);
myGLCD.setFont(SevenSegNumFont);
myGLCD.print("saniye", CENTER , 120);
}
void loop() {
counter = millis();
String elapsedTime = String(counter / 1000);
elapsedTime.toCharArray(printout, 4);
myGLCD.clrScr();
myGLCD.setColor(255, 255, 255);
myGLCD.print(printout, CENTER, 120);
delay(1000);
myGLCD.setColor(0, 0, 0);
myGLCD.print(printout, CENTER, 120);
}