-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is a dump of all of the code used in the project.
- Loading branch information
Joseph Pugh
committed
Feb 13, 2013
1 parent
63809eb
commit 4af262a
Showing
20 changed files
with
36,459 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
const int scanner = 7; | ||
const int turntable = 5; | ||
int timer = 0; | ||
int degree = 0; | ||
|
||
void setup() { | ||
pinMode(scanner, OUTPUT); | ||
pinMode(turntable, OUTPUT); | ||
digitalWrite(scanner, LOW); | ||
digitalWrite(turntable, LOW); | ||
Serial.begin(9600); | ||
Serial.println("Hello world!"); | ||
} | ||
|
||
void loop() { | ||
if (Serial.available()) { | ||
char ch = Serial.read(); | ||
if ( ch == 'f') { | ||
digitalWrite(scanner, HIGH); | ||
Serial.println("FIRIN' MAH LAZER!"); | ||
delay(2000); | ||
|
||
digitalWrite(scanner, LOW); | ||
Serial.println("turning off..."); | ||
} | ||
if ( ch == 'n') { | ||
digitalWrite(turntable, HIGH); | ||
Serial.print("spin 3 degrees... "); | ||
delay(360); | ||
digitalWrite(turntable, LOW); | ||
Serial.println("done"); | ||
degree += 3; | ||
Serial.print("total degrees: "); | ||
Serial.println(degree); | ||
} | ||
if ( ch == 'r') { | ||
Serial.println("resetting degrees..."); | ||
degree = 0; | ||
} | ||
if ( ch == 'z') { | ||
digitalWrite(turntable, HIGH); | ||
timer = millis(); | ||
} | ||
if ( ch == 'y') { | ||
digitalWrite(turntable, LOW); | ||
Serial.println(millis()-timer); | ||
timer = 0; | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
while [ 1 ] | ||
do | ||
if [ -e /tmp/scan_nolaser ] | ||
then | ||
scan_nolaser | ||
rm /tmp/scan_nolaser | ||
fi | ||
if [ -e /tmp/scan_laser ] | ||
then | ||
scan_laser | ||
rm /tmp/scan_laser | ||
fi | ||
sleep 3 | ||
done |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
touch /tmp/scan | ||
DATE=`date +%Y-%m-%d-%H-%M` | ||
mkdir /var/www/scans/$DATE | ||
send r | ||
for i in {1..120} | ||
do | ||
NUMBER=`printf %03d $i` | ||
send n | ||
sleep 1 | ||
send f | ||
takepic /var/www/scans/$DATE/$NUMBER.jpg | ||
rm /var/www/pic.jpg | ||
ln -s /var/www/scans/$DATE/$NUMBER.jpg /var/www/pic.jpg | ||
sleep 2 | ||
done | ||
rm /var/www/pic.jpg | ||
cp /var/www/scans/$DATE/$NUMBER.jpg /var/www/pic.jpg | ||
chown www-data /var/www/pic.jpg | ||
convert -delay 5 -loop 0 `find /var/www/scans/$DATE/ | grep jpg | sort` /var/www/scans/$DATE/$DATE.gif | ||
rm /tmp/scan |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
touch /tmp/scan | ||
DATE=`date +%Y-%m-%d-%H-%M` | ||
mkdir /var/www/scans/$DATE | ||
send r | ||
for i in {1..120} | ||
do | ||
NUMBER=`printf %03d $i` | ||
send n | ||
sleep 1 | ||
takepic /var/www/scans/$DATE/$NUMBER.jpg | ||
rm /var/www/pic.jpg | ||
ln -s /var/www/scans/$DATE/$NUMBER.jpg /var/www/pic.jpg | ||
done | ||
rm /var/www/pic.jpg | ||
cp /var/www/scans/$DATE/$NUMBER.jpg /var/www/pic.jpg | ||
chown www-data /var/www/pic.jpg | ||
convert -delay 5 -loop 0 `find /var/www/scans/$DATE/ | grep jpg | sort` /var/www/scans/$DATE/$DATE.gif | ||
rm /tmp/scan |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
DEVICE=`ls /dev/tty* | grep 'USB\|ACM' | head -n 1` | ||
echo $@ > $DEVICE |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
nohup scan_nolaser & |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
nohup scan_laser & |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
if [ "X$1" == "X" ] | ||
then | ||
PICTURE="/var/www/pic.jpg" | ||
else | ||
PICTURE=$1 | ||
fi | ||
fswebcam -F 3 --no-banner -S 5 $PICTURE |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.