Can you help by telling if my interpretations of the following code is correct in laymans terms?
void loop() {
int reading = digitalRead(buttonPin);
reading will equal what is read by the buttonPin
if (reading != lastButtonState) {
If the reading does not equal the buttonstate
lastDebounceTime = millis();
don't understand what is happening here, but is says lastDebounceTime equals millis
}
if ((millis() - lastDebounceTime) > debounceDelay) {
If (millis minus lastDebounceTime) is greater than debounceDelay
if (reading != buttonState) {
If reading does not equal buttonstate
buttonState = reading;
then buttonState equals reading
if (buttonState == HIGH) {
If buttonState is equal to high (pressed)
ledState1 = !ledState1;
Then ledState1 is not equal to ledState1
Some parts of the above code I don't fully understand and I hope somebody helpful on here might be able to make it clearer.