-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathStaticLightControlStrategy.cpp
More file actions
36 lines (27 loc) · 1000 Bytes
/
StaticLightControlStrategy.cpp
File metadata and controls
36 lines (27 loc) · 1000 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
* StaticLightControlStrategy.cpp
*
* Created on: 01.10.2012
* Author: mse
*/
#include "StaticLightControlStrategy.h"
#include <Arduino.h>
int ILightControlStrategy::COLOR_BLUE[LED_SIZE] = {1,0,0,1,0,0,1,0,0,1,0,0};
int ILightControlStrategy::COLOR_RED [LED_SIZE] = {0,1,0,0,1,0,0,1,0,0,1,0};
int ILightControlStrategy::COLOR_GREEN [LED_SIZE] = {0,0,1,0,0,1,0,0,1,0,0,1};
int ILightControlStrategy::COLOR_BLUE_GREEN [LED_SIZE] = {1,0,0,0,0,1,1,0,0,0,0,1};
int ILightControlStrategy::COLOR_BLUE_RED [LED_SIZE] = {1,0,0,0,1,0,1,0,0,0,1,0};
StaticLightControlStrategy::StaticLightControlStrategy(int* color) {
colorArray = color;
}
StaticLightControlStrategy::~StaticLightControlStrategy() {
}
void StaticLightControlStrategy::show() {
for (int aa = 0; aa < ILightControlStrategy::LED_SIZE; aa++) {
if (colorArray[aa] == 1) {
digitalWrite(aa + ILightControlStrategy::AVR_DIO_START, HIGH);
} else {
digitalWrite(aa + ILightControlStrategy::AVR_DIO_START, LOW);
}
}
}