File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
bootloader/examples/Blink_Unisense Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -48,21 +48,31 @@ void setup() {
4848}
4949
5050void 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+ */
6569void 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 ;
You can’t perform that action at this time.
0 commit comments