How to use LED on diffrent pins

my first LED controll project run successfully
connection for 1st one are one lead of register is in pin0 p and -ve terminal of LED is in ground and same code is given in the tutorial.
but when i make connection on other pin its not working can you please help me in coding for controlling LED on other pins except pin0

To make connections for other GPIO ports and control the LED you should just change the number inside the “digitalwrite” function to the desired digital GPIO port number.

    <button onclick="digitalWrite(0, 'HIGH');">ON</button>
    <button onclick="digitalWrite(0, 'LOW');">OFF</button>

That is just change the number 0 in this lines to the desired digital GPIO port number.

1 Like

For use LED through other GPIO pin always notice that the negative terminal of the LED should connected to the GND pin of the module. And the positive one depends on you.
ON
OFF
(NOTE: There are five GPIO digital pins and one analog pin.)

yes this was so helpfull .my pin name was wrong . now i get it thank u so much

You are welcome @pragatighatte