2 This program is free software: you can redistribute it and/or modify
3 it under the terms of the GNU Affero General Public License as
4 published by the Free Software Foundation, either version 3 of
5 the License, or (at your option) any later version.
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 GNU Affero General Public License for more details.
12 You should have received a copy of the GNU Affero General Public License
13 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 Turns on an LED on for one second, then off for one second, repeatedly.
19 This example code is in the public domain.
30 // initialize the digital pin as an output.
31 // Pin 13 has an LED connected on most Arduino boards:
33 pinMode(red0
, OUTPUT
);
34 pinMode(red1
, OUTPUT
);
35 pinMode(yellow0
, OUTPUT
);
36 pinMode(yellow1
, OUTPUT
);
37 pinMode(green0
, OUTPUT
);
38 pinMode(green1
, OUTPUT
);
42 digitalWrite(led
, HIGH
);
46 digitalWrite(led
, LOW
);
49 void ons_offs(int* ons
, int onsc
,
53 for(ii
= 0; ii
< offsc
; ii
++) {
56 for(ii
= 0; ii
< onsc
; ii
++) {
64 int yellow_wait
= 800;
65 int green_wait
= 1600;
67 ons_offs((int[]){red0
, green1
}, 2,
68 (int[]){yellow0
, green0
, red1
, yellow1
}, 4,
71 ons_offs((int[]){red0
, yellow1
}, 2,
72 (int[]){yellow0
, green0
, red1
, green1
}, 4,
75 ons_offs((int[]){red0
, red1
}, 2,
76 (int[]){yellow0
, green0
, yellow1
, green1
}, 4,
79 ons_offs((int[]){green0
, red1
}, 2,
80 (int[]){red0
, yellow0
, yellow1
, green1
}, 4,
83 ons_offs((int[]){yellow0
, red1
}, 2,
84 (int[]){red0
, green0
, yellow1
, green1
}, 4,
87 ons_offs((int[]){red0
, red1
}, 2,
88 (int[]){yellow0
, green0
, yellow1
, green1
}, 4,