Project 7 controlling led


#1


whenever i run the python code it showing success but light is not glowing


#2

Hi @mohamedabdulkadher.1 ,

Send your code here and image of your led to Bolt connection. Also change the led and check if it working.


#3


#4

Hi @mohamedabdulkadher.1,

You are using isOnline() that is used in getting the status of the device.

Connection

  1. Insert the negative leg(smaller) of the LED into the ground pin of the Bolt.
  2. Insert the positive pin(longer) of led to GPIO pins (0,1,2,3,4) of Bolt
  3. Pass the used pin in your digitalWrite function.

To switch on/off led using the digitalWrite function.

Refer the code below.

from boltiot import Bolt
api_key = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
device_id  = “BOLT1234"
mybolt = Bolt(api_key, device_id)
response = mybolt.digitalWrite('0', 'HIGH')

Reference:


#5

in this i am facing the same issue:tired_face:


#6

@mohamedabdulkadher.1 You have connected the LED to pin 0 of the Bolt, but the command to turn on the LED is sent to the pin 1.
Please change the code to send the command to pin 0.
You will need to change the first parameter in the digitalWrite() function.


#7

i had make a change in the program but still i am not getting the output.


#8

Hi @mohamedabdulkadher.1,

I think your led is faulty. Can you connect the buzzer to the bolt and run the same code and check if it working. Put the smaller pin of the buzzer to GND and longer pin to 0 of Bolt.


#9

Thanks for your help i get a output in buzzer.


#10