Trouble with looping

Hello,

So I'm new at Arduino, but not new to programming though my skills are a little rusty. I'm having a problem writing this sketch. The idea of the sketch is that when a button is pressed, an LED flashes and the letter "M" is sent to the computer and when the button is pressed again, the LED turns off and again the letter "M" is sent. I have everything working except for the flashing and reset. As of right now, the code allows me to start the flashing, but then gets hung up and will not accept another button press. It's as if it is not checking for a button change. I've tried while in place of the if clause (towards the bottom of the sketch) and even a do while. The do while didn't even check the while and would just flash without my control. Any help on this would be appreciated! Thanks!

This is on a Teensy 3.1 board.

int inPin = 20;
int outPin = 13;

int state = HIGH;
int reading;
int previous = LOW;
int blinking;

float time = 0;
float debounce = 300;
void setup()
{
pinMode(inPin, INPUT);
pinMode(outPin, OUTPUT);
delay(200);

}

void loop()
{
reading = analogRead(inPin);

if (reading == HIGH && previous == LOW && millis() - time > debounce) {
if (state == HIGH){
blinking = LOW;
state = LOW;
Keyboard.press(KEY_M);
delay(200);
Keyboard.release(KEY_M);
}
else { //supposed to start the blinking
blinking == HIGH;
Keyboard.press(KEY_M);
delay(200);
Keyboard.release(KEY_M);
state = HIGH;

}
time = millis();
}
digitalWriteFast(13, state);
previous = reading;

if (blinking == HIGH) { //this is where the problem seems to be
delay(1000);
digitalWriteFast(13, HIGH);
delay(1000);
digitalWriteFast(13, LOW);
}

}

Is there a reason why you are using analog reads instead of a digital input?

The digitalRead was taking too long. analogRead works a lot snappier. No other reason. Code works the same when digitalRead is enabled.

Astronerd:
As of right now, the code allows me to start the flashing, but then gets hung up and will not accept another button press. It's as if it is not checking for a button change.

It isn't, because of the delay()s.
It's like you boiling an egg, but not answering the telephone or doorbell until the 3 minutes is up.

Read, learn and absorb the principle in the 'blink without delay' example in either the example pages of this site or the IDE. You should also look at http://forum.arduino.cc/index.php?topic=223286.0 which is an example of how to do several things at once, without delay()s.

Astronerd:
The digitalRead was taking too long. analogRead works a lot snappier. No other reason. Code works the same when digitalRead is enabled.

That is just silly, the analog read must take about 500 times longer than a digital read.

This points to the possibility that you have not wired your push button up correctly. Have you any external resistors you need them?

Better yet is to use a connection to ground through the button and enable the internal pull up resistors.

Your code is all over the place as well.
Do not use floats for time use unsigned longs
Do not put Boolean variable in ints use boolean

The blinking bit will never work either, remember you get thousand of calls to the loop function every second.

You need to detect the change in the button state not just if it is held down or not.

The demo several things at a time probably does most of what you want.

And it does NOT use delay()

...R