File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change 44
55### Connect circuit according to the sunfounder arduino
66
7+ [ ![ "Buy Me A Coffee"] ( https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png )] ( https://www.buymeacoffee.com/harshitsoni01 )
8+
79[ Arduino circuit link] ( https://www.sunfounder.com/learn/category/Super-Kit-V2-0-for-Arduino.html )
810
911* _ Before connecting the circuit verify the pins with code and link_ *
Original file line number Diff line number Diff line change 1+ #need to be resolved
2+ #it hasn't been connected to a arduino board
3+ from pyfirmata import Arduino ,util
4+ import time
5+
6+ board = Arduino ("COM4" )
7+ it = util .Iterator (board )
8+ it .start ()
9+
10+ led = board .get_pin ("a:0:i" )
11+
12+ #buzz = board.get_pin("d:5:o")
13+
14+ while True :
15+ light = led .read ()
16+ print (light )
17+ if light > 0 :
18+ buzz = board .get_pin ("d:5:o" )
19+ buzz .write (1 )
20+ buzz = board .get_pin ("d:5:i" )
21+
22+ board .exit ()
You can’t perform that action at this time.
0 commit comments