Created
March 18, 2009 02:50
-
-
Save evanfarrar/80905 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
declare -r PI=3.14159265358979 | |
if ['id -u' != "0" ]; then | |
echo "You should be root to run this script." | |
exit 1 | |
fi | |
clear | |
echo "What is your race distance in meters?" | |
read -e RACE_DISTANCE | |
echo "What is your roller diameter in inches?" | |
read -e ROLLER_DIAMETER | |
ROLLER_CIRCUMFERENCE=`echo $PI, $ROLLER_DIAMETER|awk '{print 0.0254000 * $1 * $2}'` | |
echo $ROLLER_CIRCUMFERENCE | |
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup | |
sudo sed -i -e "s/# deb/deb/g" /etc/apt/sources.list | |
sudo apt-get update | |
sudo apt-get -y install gcc-avr avrdude avr-libc make gtkterm | |
rm ~/Desktop/shoes2.run | |
wget -O ~/Desktop/shoes2.run http://shoooes.net/dist/shoes2.run | |
chmod 700 ~/Desktop/shoes2.run | |
wget -O ~/Desktop/opensprints-autoinstall.tar.gz http://github.com/evanfarrar/opensprints/tarball/master | |
rm -rf ~/Desktop/evanfarrar-opensprints-* | |
tar -C ~/Desktop -zxf ~/Desktop/opensprints-autoinstall.tar.gz | |
rm ~/Desktop/opensprints-autoinstall.tar.gz | |
rm -rf ~/Desktop/opensprints && mkdir ~/Desktop/opensprints | |
mv ~/Desktop/evanfarrar-opensprints-*/* ~/Desktop/opensprints | |
cp ~/Desktop/opensprints/conf-sample.yml ~/Desktop/opensprints/conf.yml | |
#Sets roller_distance in conf.yml to $ROLLER_DISTANCE | |
sudo sed -i "s/race_distance: 200/race_distance: $RACE_DISTANCE/g" ~/Desktop/opensprints/conf.yml | |
#Sets roller_circumference in conf.yml to $ROLLER_CIRCUMFERENCE | |
sudo sed -i "s/roller_circumference: 1.0/roller_circumference: $ROLLER_CIRCUMFERENCE/g" ~/Desktop/opensprints/conf.yml | |
cd ~/Desktop/opensprints/firmware/arduino/basic_msg/ | |
make clean | |
make | |
echo "Connect the Arduino via USB and hit <enter>" | |
read continue | |
make upload | |
cd ~/Desktop/opensprints/ | |
xrandr --auto | |
~/Desktop/shoes2.run main.rb | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment