I have found what the problem was in the end.
The problem was that the LED was turned on and off too fast after another.
What I mean by that is that by the time the LED was set FROM HIGH to LOW, it barely had gotten time to go HIGH, resulting in only a super small blink.
I have added a delay which does not affect my timer code.
The sleep could not be bigger or equal than 60000 (ms) / BPM.
The resulting code:
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int BPM = 120;
int minSwitchState;
int plusSwitchState;
float toDelay;
long previousMillis = 0;
boolean buttonPressed;
int counter = 0;
void setup() {
Serial.begin(9600);
lcd.begin(16, 2);
updateDisplay();
//red output LED
pinMode(13, OUTPUT);
//green output LED
pinMode(10, OUTPUT);
//input buttons
pinMode(7, INPUT);
pinMode(8, INPUT);
}
void loop() {
buttonPressed = false;
minSwitchState = digitalRead(8);
plusSwitchState = digitalRead(7);
if(minSwitchState == HIGH) {
buttonPressed = true;
BPM++;
updateDisplay();
}
if(plusSwitchState == HIGH) {
buttonPressed = true;
if(BPM > 1) {
BPM--;
updateDisplay();
}
}
unsigned long currentMillis = millis();
if(currentMillis - previousMillis >= toDelay && !buttonPressed) {
counter = counter % 4 + 1;
if(counter == 1) {
digitalWrite(10, HIGH);
}else{
digitalWrite(13, HIGH);
}
delay(100);
previousMillis = currentMillis;
Serial.println(currentMillis / 1000.0);
}else{
digitalWrite(13, LOW);
digitalWrite(10, LOW);
}
}
void updateDisplay() {
toDelay = 60000.0 / (float) BPM;
lcd.clear();
lcd.print("Kies BPM: ");
lcd.setCursor(0, 1);
lcd.print(BPM);
delay(100);
}
Thanks a lot all, this can be put to [SOLVED]

!