Skip to content

Commit 504cd3a

Browse files
committed
added buymeacoffee
1 parent 571ac50 commit 504cd3a

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
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_*

light_buzzer.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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()

0 commit comments

Comments
 (0)