Ty for the help. I rewrote the code a bit, while waiting for an answer, but it shouldn't be much difference.
I did what you told me and i got me a bit closer to working, but not quite yet.
Right now it blinks on every second press, but only when the button is pressed, not for the entire time until i press the button again.
#include <SerialLCD.h>
#include <SoftwareSerial.h>
const int buttonPin = 2;
const int buttonPin1 = 7;
int count = 0;
int count1 = 0;
int lastButtonState = 0;
int buttonState = 0;
int buttonState1 = 0;
SerialLCD slcd(4,3);
void setup() {
pinMode(buttonPin, INPUT);
pinMode(buttonPin1, INPUT);
slcd.begin();
slcd.print("TEST");
Serial.begin(9600);
}
void loop(){
buttonState = digitalRead(buttonPin);
buttonState1 = digitalRead(buttonPin1);
Serial.print ("Button press count = ");
Serial.println(count, DEC);
if (buttonState != lastButtonState) {
if (buttonState == HIGH) {
count++;
}
lastButtonState = buttonState;
if (count %2 == 0){
slcd.noDisplay();
delay(200);
slcd.display();
delay(200);
}
else {
slcd.display();
}
}
}