Project 8: LED Intensity (Brightness) Control

led controlling with python
I am getting this " Invalid value for state" and henceforth led is not turning on

As per the screenshot you have done “0”,“LOW” we should be ‘0’, 'LOW’
Also check the hardware connections you have made:

  1. Product Type: Output and Interface Type- GPIO.
  2. You have to declare the variable pin in the cloud hardware section to which you have connected the LED in the module.

Please check the connection I feel it is correct only

and after correcting that minor mistake still getting the same error.

Hi @jaiswalshivani2111,

HIGH and LOW should be in capital letter.

For example :

response = mybolt.digitalWrite('0', 'HIGH')
response = mybolt.digitalWrite('0', 'LOW')

Check this link

Do let me know in case you need further assistance.

Dear, this is case sensitive program, as i can see from your screenshot your value is “Low” which is lower case and it must be in upper case that is “LOW” , and in case for " “HIGH” as well…please change it i hope it will work unless other things are correct…

Hey BoltIOT community! Well this isn’t a reply to any question. However the code snippet is relevant to the topic of controlling LED brightness using Bolt Python library. It would come in handy for those who would wish to play around with user-defined input values during run-time rather than hard-coding brightness values in source code before each run.
Hope you enjoy changing your LED brightness on the go :slight_smile:

1 Like