Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alexander Bierbrauer
authored and
Alexander Bierbrauer
committed
Dec 9, 2015
1 parent
21528ea
commit fe8a0ca
Showing
78 changed files
with
25,732 additions
and
25,731 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
# See https://help.github.com/articles/ignoring-files for more about ignoring files. | ||
# | ||
# If you find yourself ignoring temporary files generated by your text editor | ||
# or operating system, you probably want to add a global ignore instead: | ||
# git config --global core.excludesfile '~/.gitignore_global' | ||
|
||
# Ignore bundler config. | ||
/.bundle | ||
|
||
# Ignore all logfiles and tempfiles. | ||
/web/log/* | ||
!/web/log/.keep | ||
/web/tmp | ||
/web/db/easy_race_lap_timer.sqlite3 | ||
web/public/uploads/ | ||
web/public/assets | ||
web/node_modules | ||
*.o | ||
moc_* | ||
# See https://help.github.com/articles/ignoring-files for more about ignoring files. | ||
# | ||
# If you find yourself ignoring temporary files generated by your text editor | ||
# or operating system, you probably want to add a global ignore instead: | ||
# git config --global core.excludesfile '~/.gitignore_global' | ||
|
||
# Ignore bundler config. | ||
/.bundle | ||
|
||
# Ignore all logfiles and tempfiles. | ||
/web/log/* | ||
!/web/log/.keep | ||
/web/tmp | ||
/web/db/easy_race_lap_timer.sqlite3 | ||
web/public/uploads/ | ||
web/public/assets | ||
web/node_modules | ||
*.o | ||
moc_* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,82 @@ | ||
import socket | ||
import sys | ||
import dothat.backlight as backlight | ||
import dothat.lcd as lcd | ||
import dothat.touch as j | ||
import time | ||
import math | ||
import signal | ||
|
||
TCP_IP = '127.0.0.1' | ||
TCP_PORT = 3007 | ||
BUFFER_SIZE = 1024 | ||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | ||
s.connect((TCP_IP, TCP_PORT)) | ||
|
||
|
||
|
||
backlight.graph_off() | ||
backlight.graph_set_led_duty(0, 1) | ||
lcd.clear() | ||
lcd.set_cursor_position(0, 0) | ||
lcd.write("EasyRaceLapTimer") | ||
|
||
|
||
@j.on(j.UP) | ||
def handle_up(ch, evt): | ||
print("Up pressed!") | ||
lcd.clear() | ||
backlight.rgb(255, 0, 0) | ||
lcd.write("Up up and away!") | ||
|
||
|
||
@j.on(j.DOWN) | ||
def handle_down(ch, evt): | ||
print("Down pressed!") | ||
lcd.clear() | ||
backlight.rgb(0, 255, 0) | ||
lcd.write("Down down doobie down!") | ||
|
||
|
||
@j.on(j.LEFT) | ||
def handle_left(ch, evt): | ||
print("Left pressed!") | ||
lcd.clear() | ||
backlight.rgb(0, 0, 255) | ||
lcd.write("Leftie left left!") | ||
|
||
|
||
@j.on(j.RIGHT) | ||
def handle_right(ch, evt): | ||
print("Right pressed!") | ||
lcd.clear() | ||
backlight.rgb(0, 255, 255) | ||
lcd.write("Rightie tighty!") | ||
|
||
|
||
@j.on(j.BUTTON) | ||
def handle_button(ch, evt): | ||
print("Button pressed!") | ||
lcd.clear() | ||
backlight.rgb(255, 255, 255) | ||
lcd.write("Ouch!") | ||
|
||
|
||
@j.on(j.CANCEL) | ||
def handle_cancel(ch, evt): | ||
print("Cancel pressed!") | ||
lcd.clear() | ||
backlight.rgb(0, 0, 0) | ||
lcd.write("Boom!") | ||
|
||
|
||
|
||
while True: | ||
data = s.recv(BUFFER_SIZE) | ||
|
||
if str.find(data,"#") != -1: | ||
data = data.replace("#","").replace("\n","") | ||
list= data.split(" ",5) | ||
if list[0] == "NEW_LAP_TIME": | ||
lcd.set_cursor_position(0, 1) | ||
lcd.write(list[1]+ " " + str(float(list[2]) / 1000)+"secs") | ||
import socket | ||
import sys | ||
import dothat.backlight as backlight | ||
import dothat.lcd as lcd | ||
import dothat.touch as j | ||
import time | ||
import math | ||
import signal | ||
|
||
TCP_IP = '127.0.0.1' | ||
TCP_PORT = 3007 | ||
BUFFER_SIZE = 1024 | ||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | ||
s.connect((TCP_IP, TCP_PORT)) | ||
|
||
|
||
|
||
backlight.graph_off() | ||
backlight.graph_set_led_duty(0, 1) | ||
lcd.clear() | ||
lcd.set_cursor_position(0, 0) | ||
lcd.write("EasyRaceLapTimer") | ||
|
||
|
||
@j.on(j.UP) | ||
def handle_up(ch, evt): | ||
print("Up pressed!") | ||
lcd.clear() | ||
backlight.rgb(255, 0, 0) | ||
lcd.write("Up up and away!") | ||
|
||
|
||
@j.on(j.DOWN) | ||
def handle_down(ch, evt): | ||
print("Down pressed!") | ||
lcd.clear() | ||
backlight.rgb(0, 255, 0) | ||
lcd.write("Down down doobie down!") | ||
|
||
|
||
@j.on(j.LEFT) | ||
def handle_left(ch, evt): | ||
print("Left pressed!") | ||
lcd.clear() | ||
backlight.rgb(0, 0, 255) | ||
lcd.write("Leftie left left!") | ||
|
||
|
||
@j.on(j.RIGHT) | ||
def handle_right(ch, evt): | ||
print("Right pressed!") | ||
lcd.clear() | ||
backlight.rgb(0, 255, 255) | ||
lcd.write("Rightie tighty!") | ||
|
||
|
||
@j.on(j.BUTTON) | ||
def handle_button(ch, evt): | ||
print("Button pressed!") | ||
lcd.clear() | ||
backlight.rgb(255, 255, 255) | ||
lcd.write("Ouch!") | ||
|
||
|
||
@j.on(j.CANCEL) | ||
def handle_cancel(ch, evt): | ||
print("Cancel pressed!") | ||
lcd.clear() | ||
backlight.rgb(0, 0, 0) | ||
lcd.write("Boom!") | ||
|
||
|
||
|
||
while True: | ||
data = s.recv(BUFFER_SIZE) | ||
|
||
if str.find(data,"#") != -1: | ||
data = data.replace("#","").replace("\n","") | ||
list= data.split(" ",5) | ||
if list[0] == "NEW_LAP_TIME": | ||
lcd.set_cursor_position(0, 1) | ||
lcd.write(list[1]+ " " + str(float(list[2]) / 1000)+"secs") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.