2424wiringpi .pinMode (PIN_BUTTON , wiringpi .GPIO .INPUT )
2525
2626# The length of a beat in seconds
27- a_beat = .15
27+ A_BEAT = .15
2828
29- delay_between_letters = 8 * a_beat
29+ DELAY_BETWEEN_LETTERS = 8 * A_BEAT
3030
3131
3232class PiBorgLight (Light ):
33+ """
34+ Controls the illumination of PiBorg LED
35+ """
3336
3437 # Set the colour channel intensity (1 is fully on, 0 is off)
3538 red = 1
@@ -51,13 +54,13 @@ def off(self):
5154
5255
5356light = PiBorgLight ()
54- code_flasher = MorseCodeFlasher (a_beat , delay_between_letters , light )
57+ code_flasher = MorseCodeFlasher (A_BEAT , DELAY_BETWEEN_LETTERS , light )
5558
5659
5760def record_push ():
58- url = 'http://morse.pelmo.uk/ping/index.php'
61+ url = 'http://morse.pelmo.uk/ping/index.php'
5962 headers = {
60- 'Content-Type' : 'multipart/form-data' ,
63+ 'Content-Type' : 'multipart/form-data' ,
6164 'User-Agent' : 'Morse code RaspberryPi'
6265 }
6366 try :
@@ -66,7 +69,7 @@ def record_push():
6669 data = { 'ping' : 1 },
6770 timeout = 3
6871 )
69- print ('Response code: ' + str (response .status_code ))
72+ print ('Response code: ' + str (response .status_code ))
7073 except :
7174 print ('Post failed' )
7275
@@ -78,6 +81,6 @@ def record_push():
7881while True : # Run forever
7982 if wiringpi .digitalRead (PIN_BUTTON ):
8083 print ("Button was pushed!" )
81- time .sleep (2 * a_beat )
84+ time .sleep (2 * A_BEAT )
8285 send_todays_word (code_flasher )
8386 # record_push()
0 commit comments