Phil Howard | 26c7fe3 | 2016-02-27 16:03:10 +0000 | [diff] [blame] | 1 | #!/bin/sh -e |
Gordon Henderson | 3fbc564 | 2013-03-24 20:04:07 +0000 | [diff] [blame] | 2 | # |
| 3 | # blink.sh: |
| 4 | # Standard "blink" program in wiringPi. Blinks an LED connected |
| 5 | # to the first GPIO pin. |
| 6 | # |
| 7 | # Copyright (c) 2012-2013 Gordon Henderson. <projects@drogon.net> |
| 8 | ####################################################################### |
| 9 | # This file is part of wiringPi: |
| 10 | # https://projects.drogon.net/raspberry-pi/wiringpi/ |
| 11 | # |
| 12 | # wiringPi is free software: you can redistribute it and/or modify |
| 13 | # it under the terms of the GNU Lesser General Public License as published by |
| 14 | # the Free Software Foundation, either version 3 of the License, or |
| 15 | # (at your option) any later version. |
| 16 | # |
| 17 | # wiringPi is distributed in the hope that it will be useful, |
| 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 20 | # GNU Lesser General Public License for more details. |
| 21 | # |
| 22 | # You should have received a copy of the GNU Lesser General Public License |
| 23 | # along with wiringPi. If not, see <http://www.gnu.org/licenses/>. |
| 24 | ####################################################################### |
| 25 | |
| 26 | # LED Pin - wiringPi pin 0 is BCM_GPIO 17. |
| 27 | |
Phil Howard | 26c7fe3 | 2016-02-27 16:03:10 +0000 | [diff] [blame] | 28 | PIN=0 |
Gordon Henderson | 3fbc564 | 2013-03-24 20:04:07 +0000 | [diff] [blame] | 29 | |
| 30 | gpio mode $PIN out |
| 31 | |
| 32 | while true; do |
| 33 | gpio write $PIN 1 |
| 34 | sleep 0.5 |
| 35 | gpio write $PIN 0 |
| 36 | sleep 0.5 |
| 37 | done |