Thanks for trying to help me Boguz, but I cant get it working on that way either. it just makes my whole screen flickering and the time rushing down as if the delay is only 1ms.
I guess i am failing to put the commands in a good order/way into my code.
#include <LiquidCrystal.h>
#include <SimpleTimer.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int plusPin = 6;
int minPin = 7;
int I=0;
int U=0;
int T=0;
long previousMillis = 0;
long interval = 1000;
void setup() {
pinMode(plusPin, INPUT);
pinMode(minPin, INPUT);
lcd.begin(16, 2);
lcd.setCursor(0,0);
lcd.print("Verkeerstelling");
delay(1000);
}
void loop()
{
lcd.clear();
if (plusPin, LOW)
{
(I++);
}
if (minPin, LOW)
{
(U++);
}
lcd.setCursor(0,0);
lcd.print("In: ");
lcd.setCursor(4,0);
lcd.print(I);
lcd.setCursor(8,0);
lcd.print("Uit: ");
lcd.setCursor(13,0);
lcd.print(U);
T = (I-U);
lcd.setCursor(0,1);
lcd.print("Totaal: ");
lcd.setCursor(8,1);
lcd.print(T);
lcd.setCursor(13, 1);
int n = 0;
for ( n = 110; n > 0; n--)
{
lcd.setCursor(13, 1);
//delay(1000);
unsigned long currentMillis = millis();
if(currentMillis - previousMillis > interval) {
previousMillis = currentMillis;
if (lcd.print(n));
}