Published © GPL3+

Headlight Sensor

Governing the intensity of light and switching on/off the light according to the surrounding intensity of light.

IntermediateFull instructions provided326
Headlight Sensor

Story

Read more

Schematics

Final Circuit Connection

Code

Project Code

Python
import json
from boltiot import Bolt  


API_KEY='10a6d7ac-9e36-48a8-900b-a7a4b0e92a61'
DEVICE_ID='BOLT291960'

limit=25

While True:
 Reading=mybolt.analogRead('A0')
 data=json.loads(Reading)
 if int(data['value'])> limit:
  res=mybolt.digitalWrite('0','HIGH')
 else:
  res=mybolt.digitalWt=rite('0','LOW')
 print(res)

Credits

Comments