-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathendbips.py
61 lines (55 loc) · 1.28 KB
/
endbips.py
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#import os
from time import sleep
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
buzzpin=18 # (GPIO18)
GPIO.setup(buzzpin,GPIO.OUT)
loop = 2 # number of morse code loops
def morsecode_bips ():
#Dot Dot Dot
GPIO.setmode(GPIO.BCM)
GPIO.setup(buzzpin, GPIO.OUT)
GPIO.output(buzzpin,GPIO.HIGH)
sleep(.1)
GPIO.output(buzzpin,GPIO.LOW)
sleep(.1)
GPIO.output(buzzpin,GPIO.HIGH)
sleep(.1)
GPIO.output(buzzpin,GPIO.LOW)
sleep(.1)
GPIO.output(buzzpin,GPIO.HIGH)
sleep(.1)
#Dash Dash Dash
GPIO.output(buzzpin,GPIO.LOW)
sleep(.2)
GPIO.output(buzzpin,GPIO.HIGH)
sleep(.2)
GPIO.output(buzzpin,GPIO.LOW)
sleep(.2)
GPIO.output(buzzpin,GPIO.HIGH)
sleep(.2)
GPIO.output(buzzpin,GPIO.LOW)
sleep(.2)
GPIO.output(buzzpin,GPIO.HIGH)
sleep(.2)
GPIO.output(buzzpin,GPIO.LOW)
sleep(.2)
#Dot Dot Dot
GPIO.output(buzzpin,GPIO.HIGH)
sleep(.1)
GPIO.output(buzzpin,GPIO.LOW)
sleep(.1)
GPIO.output(buzzpin,GPIO.HIGH)
sleep(.1)
GPIO.output(buzzpin,GPIO.LOW)
sleep(.1)
GPIO.output(buzzpin,GPIO.HIGH)
sleep(.1)
GPIO.output(buzzpin,GPIO.LOW)
sleep(.7)
def test_end():
for i in range(0,loop):
morsecode_bips ()
#os.system('clear')
#test_end()