8 years ago.

Blink/Unblink

Hello this is the simple code for blinking

  1. include "mbed.h"

DigitalOut myled(LED1); original DigitalOut myled(D6); modified

int main() { while(1) { myled = 1; wait(0.2); myled = 0; wait(0.2); } }

I want to make it blink when 1 pressed the pushbutton and make it stop blinking and turns off when pressed again and blink again when pressed... How do I make this cycle happens please help

Be the first to answer this question.