install_pi.sh 881 B

1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/bash
  2. sudo apt-get update
  3. sudo apt-get install -y build-essential bison flex automake libelf-dev libusb-1.0-0-dev libusb-dev libftdi-dev libftdi1 zip unzip
  4. wget http://download.savannah.gnu.org/releases/avrdude/avrdude-6.1.tar.gz
  5. tar xvfz avrdude-6.1.tar.gz
  6. cd avrdude-6.1
  7. ./configure --enable-linuxgpio
  8. make -j4
  9. sudo make install
  10. if [ -f ~/avrdude_gpio.conf ]
  11. then
  12. rm ~/avrdude_gpio.conf
  13. fi
  14. cp /usr/local/etc/avrdude.conf ~/avrdude_gpio.conf
  15. cat <<'EOF'>> ~/avrdude_gpio.conf
  16. # Linux GPIO configuration for avrdude.
  17. # Change the lines below to the GPIO pins connected to the AVR.
  18. programmer
  19. id = "linuxgpio";
  20. desc = "Use the Linux sysfs interface to bitbang GPIO lines";
  21. type = "linuxgpio";
  22. reset = 4;
  23. sck = 11;
  24. mosi = 10;
  25. miso = 9;
  26. ;
  27. EOF
  28. sudo cp ~/avrdude_gpio.conf /usr/local/etc/avrdude.conf
  29. echo ""
  30. sudo avrdude -c linuxgpio -p atmega328p -v