Skip to content

Commit b442527

Browse files
authored
Remove color comments, ledBlink function intensity (#98)
1 parent 098b8e0 commit b442527

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

bootloader/examples/Blink_Unisense/Blink_Unisense.ino

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,21 +48,31 @@ void setup() {
4848
}
4949

5050
void loop() {
51-
ledBlink(green, 1000); //blue
51+
//cycle through LED colour configurations
52+
ledBlink(green, 1000);
5253
delay(1000);
53-
ledBlink(blue, 1000); //green
54+
ledBlink(blue, 1000);
5455
delay(1000);
5556
ledBlink(red, 1000);
5657
delay(1000);
5758
ledBlink(cyan, 1000);
5859
delay(1000);
59-
ledBlink(magenta, 1000); //yellow
60+
ledBlink(magenta, 1000);
6061
delay(1000);
61-
ledBlink(yellow, 1000); //magenta
62+
ledBlink(yellow, 1000);
6263
delay(1000);
6364
}
6465

66+
/**
67+
* Blink a given color for a set duration in milliseconds.
68+
*/
6569
void ledBlink(uint8_t color, uint32_t duration)
70+
/**
71+
* Intensity is defined in 256 levels according to table 7 of the IS31FL3194 datasheet:
72+
* 0x00 -> 0
73+
* 0x20 -> I_max * (2^7) / 256 = I_max * 1/2
74+
* 0xFF -> I_max * (2^7 + 2^6 + 2^5 + 2^4 + 2^3 + 2^2 + 2^1 + 2^0) / 255 ~= I_max
75+
*/
6676
{
6777
if(color == green) {
6878
_out1 = 0x00;

0 commit comments

Comments
 (0)