File tree 6 files changed +74
-0
lines changed
6 files changed +74
-0
lines changed Original file line number Diff line number Diff line change
1
+ .vscode /
2
+ .git
Original file line number Diff line number Diff line change
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 ())
Original file line number Diff line number Diff line change
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 ()
Original file line number Diff line number Diff line change
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 >
Original file line number Diff line number Diff line change
1
+ from tkinter import *
2
+ m = Tk ()
3
+ thelabel = Label (m , text = "This is easy!!" )
4
+ thelabel .pack ()
5
+ m .mainloop ()
Original file line number Diff line number Diff line change
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
+
You can’t perform that action at this time.
0 commit comments