4 #include <MultiDecoder.h>
18 return (
led_t) ((int) type - 1);
21 static void printVariable(Stream& stream,
const char *variableName,
unsigned long value) {
22 stream.print(variableName);
24 stream.println(value);
29 #ifdef IRRECEIVER_1_PIN
34 #ifdef IRRECEIVER_2_PIN
39 #ifdef IRRECEIVER_3_PIN
44 #ifdef IRRECEIVER_4_PIN
49 #ifdef IRRECEIVER_5_PIN
54 #ifdef IRRECEIVER_6_PIN
56 return IRRECEIVER_6_PIN;
59 #ifdef IRRECEIVER_7_PIN
61 return IRRECEIVER_7_PIN;
64 #ifdef IRRECEIVER_8_PIN
66 return IRRECEIVER_8_PIN;
73 #ifdef IRRECEIVER_1_PIN
78 #ifdef IRRECEIVER_2_PIN
83 #ifdef IRRECEIVER_3_PIN
88 #ifdef IRRECEIVER_4_PIN
93 #ifdef IRRECEIVER_5_PIN
98 #ifdef IRRECEIVER_6_PIN
103 #ifdef IRRECEIVER_7_PIN
108 #ifdef IRRECEIVER_8_PIN
116 #ifdef SIGNAL_LED_1_GND
117 pinMode(SIGNAL_LED_1_GND, OUTPUT);
118 digitalWrite(SIGNAL_LED_1_GND, LOW);
121 #ifdef SIGNAL_LED_2_GND
126 #ifdef SIGNAL_LED_3_GND
131 #ifdef SIGNAL_LED_4_GND
136 #ifdef SIGNAL_LED_5_GND
141 #ifdef SIGNAL_LED_6_GND
146 #ifdef SIGNAL_LED_7_GND
151 #ifdef SIGNAL_LED_8_GND
158 #ifdef IRRECEIVER_1_GND
163 #ifdef IRRECEIVER_2_GND
164 pinMode(IRRECEIVER_2_GND, OUTPUT);
165 digitalWrite(IRRECEIVER_2_GND, LOW);
168 #ifdef IRRECEIVER_3_GND
169 pinMode(IRRECEIVER_3_GND, OUTPUT);
170 digitalWrite(IRRECEIVER_3_GND, LOW);
173 #ifdef IRRECEIVER_4_GND
174 pinMode(IRRECEIVER_4_GND, OUTPUT);
175 digitalWrite(IRRECEIVER_4_GND, LOW);
178 #ifdef IRRECEIVER_5_GND
179 pinMode(IRRECEIVER_5_GND, OUTPUT);
180 digitalWrite(IRRECEIVER_5_GND, LOW);
183 #ifdef IRRECEIVER_6_GND
184 pinMode(IRRECEIVER_6_GND, OUTPUT);
185 digitalWrite(IRRECEIVER_6_GND, LOW);
188 #ifdef IRRECEIVER_7_GND
189 pinMode(IRRECEIVER_7_GND, OUTPUT);
190 digitalWrite(IRRECEIVER_7_GND, LOW);
193 #ifdef IRRECEIVER_8_GND
194 pinMode(IRRECEIVER_8_GND, OUTPUT);
195 digitalWrite(IRRECEIVER_8_GND, LOW);
198 #ifdef IRRECEIVER_1_VCC
203 #ifdef IRRECEIVER_2_VCC
204 pinMode(IRRECEIVER_2_VCC, OUTPUT);
205 digitalWrite(IRRECEIVER_2_VCC, HIGH);
208 #ifdef IRRECEIVER_3_VCC
209 pinMode(IRRECEIVER_3_VCC, OUTPUT);
210 digitalWrite(IRRECEIVER_3_VCC, HIGH);
213 #ifdef IRRECEIVER_4_VCC
214 pinMode(IRRECEIVER_4_VCC, OUTPUT);
215 digitalWrite(IRRECEIVER_4_VCC, HIGH);
218 #ifdef IRRECEIVER_5_VCC
219 pinMode(IRRECEIVER_5_VCC, OUTPUT);
220 digitalWrite(IRRECEIVER_5_VCC, HIGH);
223 #ifdef IRRECEIVER_6_VCC
224 pinMode(IRRECEIVER_6_VCC, OUTPUT);
225 digitalWrite(IRRECEIVER_6_VCC, HIGH);
228 #ifdef IRRECEIVER_7_VCC
229 pinMode(IRRECEIVER_7_VCC, OUTPUT);
230 digitalWrite(IRRECEIVER_7_VCC, HIGH);
233 #ifdef IRRECEIVER_8_VCC
234 pinMode(IRRECEIVER_8_VCC, OUTPUT);
235 digitalWrite(IRRECEIVER_8_VCC, HIGH);
240 #ifdef IRSENSOR_1_GND
245 #ifdef IRSENSOR_2_GND
246 pinMode(IRSENSOR_2_GND, OUTPUT);
247 digitalWrite(IRSENSOR_2_GND, LOW);
250 #ifdef IRSENSOR_3_GND
251 pinMode(IRSENSOR_3_GND, OUTPUT);
252 digitalWrite(IRSENSOR_3_GND, LOW);
255 #ifdef IRSENSOR_4_GND
256 pinMode(IRSENSOR_4_GND, OUTPUT);
257 digitalWrite(IRSENSOR_4_GND, LOW);
260 #ifdef IRSENSOR_5_GND
261 pinMode(IRSENSOR_5_GND, OUTPUT);
262 digitalWrite(IRSENSOR_5_GND, LOW);
265 #ifdef IRSENSOR_6_GND
266 pinMode(IRSENSOR_6_GND, OUTPUT);
267 digitalWrite(IRSENSOR_6_GND, LOW);
270 #ifdef IRSENSOR_7_GND
271 pinMode(IRSENSOR_7_GND, OUTPUT);
272 digitalWrite(IRSENSOR_7_GND, LOW);
275 #ifdef IRSENSOR_8_GND
276 pinMode(IRSENSOR_8_GND, OUTPUT);
277 digitalWrite(IRSENSOR_8_GND, LOW);
280 #ifdef IRSENSOR_1_VCC
285 #ifdef IRSENSOR_2_VCC
286 pinMode(IRSENSOR_2_VCC, OUTPUT);
287 digitalWrite(IRSENSOR_2_VCC, HIGH);
290 #ifdef IRSENSOR_3_VCC
291 pinMode(IRSENSOR_3_VCC, OUTPUT);
292 digitalWrite(IRSENSOR_3_VCC, HIGH);
295 #ifdef IRSENSOR_4_VCC
296 pinMode(IRSENSOR_4_VCC, OUTPUT);
297 digitalWrite(IRSENSOR_4_VCC, HIGH);
300 #ifdef IRSENSOR_5_VCC
301 pinMode(IRSENSOR_5_VCC, OUTPUT);
302 digitalWrite(IRSENSOR_5_VCC, HIGH);
305 #ifdef IRSENSOR_6_VCC
306 pinMode(IRSENSOR_6_VCC, OUTPUT);
307 digitalWrite(IRSENSOR_6_VCC, HIGH);
310 #ifdef IRSENSOR_7_VCC
311 pinMode(IRSENSOR_7_VCC, OUTPUT);
312 digitalWrite(IRSENSOR_7_VCC, HIGH);
315 #ifdef IRSENSOR_8_VCC
316 pinMode(IRSENSOR_8_VCC, OUTPUT);
317 digitalWrite(IRSENSOR_8_VCC, HIGH);
323 #ifdef IRSENSOR_1_PIN
328 #ifdef IRSENSOR_2_PIN
333 #ifdef IRSENSOR_3_PIN
338 #ifdef IRSENSOR_4_PIN
343 #ifdef IRSENSOR_5_PIN
348 #ifdef IRSENSOR_6_PIN
353 #ifdef IRSENSOR_7_PIN
358 #ifdef IRSENSOR_8_PIN
366 #define NON_MOD_PIN invalidPin
static const uint8_t receiverNo
static const unsigned sensorNo
static void printVariable(Stream &stream, const char *variableName, unsigned long value)
static bool sensorPullup(uint8_t sensorNo UNUSED)
static unsigned long freeRam()
static void setupSensors()
static pin_t receiverPin(uint8_t receiverNo UNUSED)
static bool receiverPullup(uint8_t receiverNo UNUSED)
static void setupReceivers()
static led_t decode2logicalLed(MultiDecoder::Type type)
#define IRSENSOR_4_PULLUP_VALUE
#define IRSENSOR_1_PULLUP_VALUE
#define IRRECEIVER_3_PULLUP_VALUE
#define IRRECEIVER_5_PULLUP_VALUE
#define IRSENSOR_5_PULLUP_VALUE
#define IRSENSOR_3_PULLUP_VALUE
#define IRSENSOR_6_PULLUP_VALUE
#define IRSENSOR_2_PULLUP_VALUE
#define IRSENSOR_8_PULLUP_VALUE
#define IRRECEIVER_8_PULLUP_VALUE
#define IRSENSOR_7_PULLUP_VALUE
#define IRRECEIVER_6_PULLUP_VALUE
#define IRRECEIVER_7_PULLUP_VALUE
#define IRRECEIVER_2_PULLUP_VALUE
#define IRRECEIVER_4_PULLUP_VALUE
#define IRRECEIVER_1_PULLUP_VALUE