-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexemplo.py
More file actions
28 lines (21 loc) · 933 Bytes
/
exemplo.py
File metadata and controls
28 lines (21 loc) · 933 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
"""
Exemplo obtido na internet
https://www.youtube.com/watch?v=vLuzO_vJrW4
https://drive.google.com/file/d/1kFZamh1PqE2c6qmbjlA-HVlR-dtZjEDo/view
acessado em 08/04/2020 as 11:05
"""
from pyfirmata import Arduino, util
import time
#void setup(){
Uno = Arduino('/dev/ttyACM0')
# Serial.begin(9600);
print('Olá Mundo!') # Serial.println("Olá Mundo!");
#}
while True: # void loop(){
Uno.digital[13].write(1) # digitalWrite(13, HIGH);
print('LED ligado') # Serial.println("LED ligado");
time.sleep(0.5) # delay(1000);
Uno.digital[13].write(0) # digitalWrite(13, LOW);
print('LED desligado') # Serial.println("LED desligado");
time.sleep(1) # delay(1000);
#}