im bad at this, to simplify it further for me i removed trying to blink the led for now, using your code i tried to just turn the led on pin 13 on and off, after uploading the code the led is off, i press the button and the led turns on, when i press the button again it doesnt turn off.
here is what i have done with your code
const int buttonPin = 2; // the number of the pushbutton pin
const int ledPin = 13; // the number of the LED pin
int currState;
int prevState = LOW;
bool blinking = false;
void setup() {
pinMode(ledPin, OUTPUT); // initialize the LED pin as an output
pinMode(buttonPin, INPUT); // initialize the pushbutton pin as an input
}
void loop(){
currState = digitalRead(buttonPin); //check the current state of the button pin
if (currState != prevState){ //the button has been pressed
if(currState == HIGH){ //not sure what this is doing
blinking = !blinking; //not sure what this is doing
}
}
prevState = currState; //not sure what this is doing
if (blinking){
digitalWrite(ledPin, HIGH);
}
}
cheers, Ash.