LED not turning off

In the controlling LED project my led is turning ON when clicked on ON button, but it is not turning OFF when clicked on OFF…I have checked the code its perfect.

Check on which pin the LED is connected and make sure u have written the same value(pin number) in the first parameter of digitalWrite() function and check whether the LED is connected properly or not.

1 Like

Please check your connection properly, make sure that you are connecting the LED to the correct pin number (as mentioned in the code) and ground pin. You can even change the resister, also try with other LED which is given in the Bolt Kit. Hope this works for you.

Check digital pins using 0 or 1

Check the code. Make sure that you have written the same pin to “OFF” button as you have written for “ON” button.

Check if all the connections are in accordance with your code, i.e, the pins in the code match with the pins in your Hardware connection

Check the digitalWrite status whether it’s HIGH or LOW…for off you should have mentioned LOW

Please check the connection of your hardware and the input given in the BOLTCLOUD (Hardware section). Make sure that you gave is 0.

Hey, Check you circuit connection as well as the HTML code. There can be a flaw in one of them.

make sure the digitalWrite() function parameters are given correctly,
check the value key to be ‘LOW’ so that the bulb gets off,so basically cross-check the code you’ve written in html

hi @bablisahu8983,

In digitalWrite() Function, first parameter is pin number and second parameter is ‘HIGH’ or ‘LOW’. HIGH is use for ON the LED and LOW is use for OFF the LED. so, set LOW value in second parameter of digitalWrite() function when you OFF the LED.

Note: sure that LED +ve pin is connected on which pin on Bolt Module. Use this same pin number in digitalWrite() function.

Please check your connection properly, make sure that you are connecting the LED to the correct pin number (as mentioned in the code) and ground pin. You can even change the resister, also try with other LED which is given in the Bolt Kit.