How to connect two leds at same time and make it glow

i need ur help guys i need to use two leds for my project can u help me guys

Use this code to connect two leds. Use same ground pin for both the leds. You may use pin 1,2,3 or 4 instead of A0 pin.

   <script type="text/javascript" src=""></script>
    <button onclick="digitalWrite(0, 'HIGH');">ON</button>
    <button onclick="digitalWrite(0, 'LOW');">OFF</button>
    <button onclick="digitalWrite(A0,'HIGH');>ON</button>
    <button onclick="digitalWrite(A0, 'LOW');">OFF</button>

i hope this will give you your desired result.
Let me know if this work.

Hi @push1970

You can use digitalMultiwrite command to control multiple pins using a single call.{API_KEY}/digitalMultiWrite?pins=4,1,2&states=HIGH,LOW,HIGH&deviceName={DEVICE_ID}

1 Like

Thanks you sir I got it :+1:

I tried this command but it’s not working
Could you please send me the complete html code(for bolt cloud) to control three pin of bolt IoT module(like controlling three LEDs).


Please check the command again and make sure you replace api_key and device_name correctly.

Hi @yeshwant.naik

Bolt IoT Platform ON OFF
<script type="text/javascript" >
function ledon()
function ledoff()

//The above code is running quite well but when i’m using the command
in place of digitalWrite(1,‘HIGH’)&digitalWrite(2,‘HIGH’)&digitalWrite(3,‘HIGH’);
Then LEDs are not glowing(not even a single LED).
Could you please guide me in writing the digitalMultiWrite cmd in above code to perform the same activity.

@push1970 I will suggest you to use the bread-board if you want to use two led at the same time with same pin. Just make sure that you will need a bread-board and jumping wires. otherwise you can go with the different coding