Forums Arduino Tutorial Discussions make LED go ON and OFF using Microcontroller

Tagged: , ,

This topic contains 1 reply, has 2 voices, and was last updated by  Bitahwa Bindu 1 year, 1 month ago.

  • Author
  • #2563


    Hi, I need help.
    I’m trying to make an LED go on and off using a micro controller, but using a bush button.
    If i press it once it turns the LED on and it remains on, if I press it again it turns the LED off.
    Please help me make that code.

  • #2567

    Bitahwa Bindu

    HI. You can use the compliment operator ‘~’ to invert the current status. If button is pressed, it compliments the output.

You must be logged in to reply to this topic.