forked from DeadBugPrototypes/Microwell_LED_V3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMicrowell_LED_V3.ino
42 lines (36 loc) · 1.15 KB
/
Microwell_LED_V3.ino
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
36
37
38
39
40
41
42
#include <Wire.h>
#define RESETpin 5
int LEDvalues[6][16] = {
{20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20},
{40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40},
{60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60},
{80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80},
{100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100},
{120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120},
};
void setup()
{
pinMode(RESETpin, OUTPUT);
digitalWrite(RESETpin, HIGH);
Wire.begin();
int LEDbank = 0;
for (int LEDbankAddress=0x61; LEDbankAddress<0x67; LEDbankAddress++)
{
Wire.beginTransmission(LEDbankAddress);
Wire.write(byte(0b10000000));
Wire.write(byte(0));
Wire.write(byte(0));
for (int i=0; i< 16; i++)
Wire.write(byte(LEDvalues[LEDbank][i]));
Wire.write(byte(0xFF));
Wire.write(byte(0));
for (int i=0; i< 4; i++)
Wire.write(byte(0xFF));
Wire.endTransmission();
LEDbank++;
}
}
void loop()
{
delay(1000);
}