i have typed the same code but i am getting an error for making a button for led control
This doesn’t look like the required code. Are you trying to simply control led brightness on Cloud?
OR Are you trying to control LED using VPS(Digital Ocean/ VMWare)?
i am trying to control led brightness on cloud
Then you should be creating a HTML file rather than JS
Where did you get this code from…
If I’m not wrong this is what you want…
LED Brigthness ranges from 0 to 255
If you wish to add a slider that would toggle the brightness.
Check this out