3 * Simple sequence over the first 12 GPIO pins - LEDs
4 * Aimed at the Gertboard, but it's fairly generic.
6 * Copyright (c) 2012-2013 Gordon Henderson. <projects@drogon.net>
7 ***********************************************************************
8 * This file is part of wiringPi:
9 * https://projects.drogon.net/raspberry-pi/wiringpi/
11 * wiringPi is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License as published by
13 * the Free Software Foundation, either version 3 of the License, or
14 * (at your option) any later version.
16 * wiringPi is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License for more details.
21 * You should have received a copy of the GNU Lesser General Public License
22 * along with wiringPi. If not, see <http://www.gnu.org/licenses/>.
23 ***********************************************************************
29 // Simple sequencer data
30 // Triplets of LED, On/Off and delay
49 0, 0, 1, // Extra delay
68 0, 0, 1, // Extra delay
70 0, 9, 0, // End marker
81 printf ("Raspberry Pi - 12-LED Sequence\n") ;
82 printf ("==============================\n") ;
84 printf ("Connect LEDs up to the first 8 GPIO pins, then pins 11, 10, 13, 12 in\n") ;
85 printf (" that order, then sit back and watch the show!\n") ;
89 for (pin = 0 ; pin < 14 ; ++pin)
90 pinMode (pin, OUTPUT) ;
96 l = data [dataPtr++] ; // LED
97 s = data [dataPtr++] ; // State
98 d = data [dataPtr++] ; // Duration (10ths)
100 if (s == 9) // 9 -> End Marker
106 digitalWrite (l, s) ;