Skip to content

Commit a4bbb2e

Browse files
committed
changes to py programs and new arduino progs
1 parent be5d6ab commit a4bbb2e

File tree

6 files changed

+74
-0
lines changed

6 files changed

+74
-0
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.vscode/
2+
.git

ard_test.py

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
try:
2+
from pyfirmata import Arduino, util
3+
except:
4+
import pip
5+
pip.main(['install','pyfirmata'])
6+
from pyfirmata import Arduino, util
7+
8+
import time
9+
board = Arduino("COM4")
10+
it = util.Iterator(board)
11+
it.start()
12+
Tv1 = board.get_pin('a:0:i')#'a'nalog/'d'igital:pin number:'i'nput/'o'utput/'p'wm
13+
time.sleep(1)
14+
print(Tv1.read())

blinkled.py

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
from pyfirmata import Arduino, util
3+
import time
4+
5+
board = Arduino("COM4")
6+
it = util.Iterator(board)
7+
it.start()
8+
print("Hello!Arduino")
9+
LED = board.get_pin("d:13:o")
10+
11+
while True:
12+
LED.write(1)
13+
time.sleep(0.5)
14+
LED.write(0)
15+
time.sleep(0.5)
16+
17+
board.exit()

dice.html

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!doctype html>
2+
3+
<html lang="en">
4+
<head>
5+
<meta charset="utf-8">
6+
7+
<title>The HTML5 Herald</title>
8+
<meta name="description" content="The HTML5 Herald">
9+
<meta name="author" content="SitePoint">
10+
11+
<link rel="stylesheet" href="css/styles.css?v=1.0">
12+
13+
</head>
14+
<p>WELCOME TO DICE SIMULATOR!! </p>
15+
<body>
16+
<p>YOLO </p>
17+
</body>
18+
</html>

kinter.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from tkinter import *
2+
m = Tk()
3+
thelabel = Label(m, text = "This is easy!!")
4+
thelabel.pack()
5+
m.mainloop()

switch_led.py

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from pyfirmata import Arduino, util
2+
import time
3+
4+
board = Arduino("COM4")
5+
it = util.Iterator(board)
6+
it.start()
7+
8+
sw = board.get_pin("d:3:i")
9+
led = board.get_pin("d:13:o")
10+
11+
while True:
12+
value = sw.read()
13+
if value == 1:
14+
led.write(1)
15+
else:
16+
led.write(0)
17+
board.exit()
18+

0 commit comments

Comments
 (0)