Controlling Led

Do we have to give this line
singleButton({name:"Led On", action:"digitalWrite", pin:"0", value:"HIGH"})
in the body tag of the code to control Led?

No you dont have to include that line in the body tag of the html file. In fact, you won’t need an html file at all for that line.
In the code section, you need to create a javascript file with .js extension and write the above line.
singleButton({name:“Led On”, action:“digitalWrite”, pin:“0”, value:“HIGH”})
This line itself is enough for switching on the LED.
Good luck!

Thank You! It works!

1 Like