# HG changeset patch # User Christophe Lincoln # Date 1398503476 -7200 # Node ID 8d2fe01fe16fa4e8eec3e410290a45da72a36846 # Parent 32e4a7121e8f333def0b4b0a4490bf47860b8f95 tazberry: add support for breakout boards diff -r 32e4a7121e8f -r 8d2fe01fe16f rpi/tazberry --- a/rpi/tazberry Sat Apr 26 10:43:15 2014 +0200 +++ b/rpi/tazberry Sat Apr 26 11:11:16 2014 +0200 @@ -6,6 +6,7 @@ # Author: Christophe Lincoln # . /lib/libtaz.sh +check_root title="{ TazBerry }" config="/boot/config.txt" @@ -290,6 +291,38 @@ [ "$?" == 0 ] && echo reboot ##### } +# Breakout bords! +boards_box() { + dialog \ + --clear \ + --title "$title" \ + --ok-label "Exec" \ + --cancel-label "Quit" \ + --menu "\nSetup or use a breakout board" ${height} ${width} 14 \ +"cam-setup" "$(gettext 'Configure your Pi to use a Camera')" \ +"piglow" "$(gettext 'Setup your Pi to use PiGlow')" 2>${tmp} + + # Handle options + case "$?" in + 1|255) rm -rf ${tmpdir} && exit 0 ;; + esac + + # Handle actions + action=$(cat $tmp) + case "$action" in + cam-setup) + picam_setup ;; + piglow) + for pkg in python-rpi-pyglow wiringpi-piglow; do + spk-add ${pkg} + done + newline + echo -n "Do you wish to try the leds [y/N] ? " ; read anser + [ "$anser" == "y" ] && echo "Enter a value between: 5-255" \ + && pyglow test + esac +} + # Main Dialog menu main_box() { dialog \ @@ -300,7 +333,7 @@ --menu "" ${height} ${width} 14 \ "rpi-stats" "$(gettext 'Show some RPi system stats')" \ "gpu-mem" "$(gettext 'Set memory split between ARM and GPU')" \ -"cam-setup" "$(gettext 'Configure your Pi to use the Camera')" \ +"boards" "$(gettext 'Boards settings and tools (Camera, PyGlow)')" \ "act-led" "$(gettext 'Test the RPi onboard ACT green led')" \ "oclock" "$(gettext 'Overclocking configuration')" \ "rpi-turbo" "$(gettext 'Enable or disable RPi turbo on next boot')" \ @@ -324,8 +357,8 @@ msg_box "RPi Stats" "$(rpi_stats)" ;; gpu-mem) gpu_mem_box ;; - cam-setup) - picam_setup ;; + boards) + boards_box ;; act-led) brightness="/sys/class/leds/led0/brightness" (echo "1" > ${brightness}