public
Description: Bringing GoldSprints to the masses.
Homepage: http://www.opensprints.com/
Clone URL: git://github.com/evanfarrar/opensprints.git
Linux, you are an enigma wrapped in a mystery wrapped in another enigma.
evanfarrar (author)
Sat Jul 19 19:24:20 -0700 2008
commit  4e2dda04b9ed56e4cb4f58c8d9401bc9446fcc80
tree    0378419bfa3631af428a1963776f5d2c3a398f14
parent  f64b8f8c6af33519d0c15baea630fd4e3b57d59c
...
39
40
41
42
43
 
44
45
46
...
71
72
73
74
75
 
 
76
77
78
...
167
168
169
170
 
171
...
39
40
41
 
 
42
43
44
45
...
70
71
72
 
 
73
74
75
76
77
...
166
167
168
 
169
170
0
@@ -39,8 +39,7 @@ void turnOffLEDs() {
0
 }
0
 
0
 void setup() {
0
-
0
- Serial.begin(57600);
0
+ Serial.begin(115200);
0
   pinMode(statusLEDPin, OUTPUT);
0
   pinMode(sensor1Pin, INPUT);
0
   pinMode(sensor2Pin, INPUT);
0
@@ -71,8 +70,8 @@ void blinkLED() {
0
 }
0
 
0
 void raceStart() {
0
- int racer1ticks = 0;
0
- int racer2ticks = 0;
0
+ racer1Ticks = 0;
0
+ racer2Ticks = 0;
0
   raceStartMillis = millis();
0
   turnOffLEDs();
0
 }
0
@@ -167,5 +166,5 @@ void loop() {
0
     
0
   }
0
   
0
- updateProgressLEDs();
0
+ updateProgressLEDs();
0
 }
...
4
5
6
 
 
7
8
9
10
11
12
13
 
 
14
15
16
...
24
25
26
 
27
28
29
...
4
5
6
7
8
9
10
11
12
13
14
 
15
16
17
18
19
...
27
28
29
30
31
32
33
0
@@ -4,13 +4,16 @@ class Sensor
0
   def initialize(queue, filename=nil)
0
     @queue = queue
0
     raise 'File Not Writable!' unless File.writable?(filename)
0
+ #HACK oogity boogity magic happens here:
0
+ `stty -F #{filename} cs8 115200 ignbrk -brkint -icrnl -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke -noflsh -ixon -crtscts`
0
     @f = File.open(filename, 'w+')
0
   end
0
 
0
   def start
0
     @t.kill if @t
0
     @t = Thread.new do
0
- @f.puts 'g'
0
+ @f.putc 'g'
0
+ @f.flush
0
       while true do
0
         l = @f.readline
0
         if l=~/:/
0
@@ -24,6 +27,7 @@ class Sensor
0
 
0
   def stop
0
     @f.puts 's'
0
+ @f.flush
0
     @t.kill
0
   end
0
 end

Comments

  • toothrot Fri Jul 25 15:19:18 -0700 2008

    wow. wild.