M1 Enclosure LED

I’m trying to get the ADP8866 LED and subsequent user LEDs on the M1 enclosure working with my Muon/M404.

I’ve looked at the official Particle repo for the ADP8866: Particle driver library to support ADP8866 LED Driver. However, it’s several years at this point. Using some outdated calls. And for the life of me, I cannot get this to work on the Muon with an m404. The official docs mention “coming soon”: M1 enclosure docs - link to User LEDS

Has anyone got any more information on the control library for the M1 enclosure? Or anyone been able to take the older repo and modify it to work?

It should work, at least in Workbench. Copy the particle-adp8866 and particle-led into the lib directory of your project.

If you are trying to use the test programs, you will need to make a modification, basically commenting out this section of code in test.cpp:

#if !defined(SYSTEM_VERSION_400) // This code is used only for Device OS 3.x and earlier
STARTUP(
    // set done flag
    uint8_t read_value = 0x01;
    dct_read_app_data_copy(DCT_SETUP_DONE_OFFSET, &read_value, 1);
    if(read_value != 1)
    {
        const uint8_t write_value = 1;
        dct_write_app_data(&write_value, DCT_SETUP_DONE_OFFSET, 1);
    }
);
#endif

I applied the test.cpp fix to the particle-adp8866 library main branch, so if you get it from there now it will already have the fix.

@rickkas7 , thanks for the quick reply and updates. I’ve taken to just creating a new project, adding only the particle-adp8866 and particle-led libraries to the application, and copying the raw from 2-rgb/test.cpp. I’m having the same as results as my previous attempts. Logging looks right:

Serial connection closed.  Attempting to reconnect...
Serial monitor opened successfully:
0000002061 [app] INFO: ### ADP8866-RGB Test ###
0000002120 [app] INFO: ### Enter TOGGLE Test ###
0000002133 [app] INFO: toggle_test: RGB_0  state == ON
0000002648 [app] INFO: toggle_test: RGB_0  state == OFF
0000003163 [app] INFO: toggle_test: RGB_1  state == ON
0000003678 [app] INFO: toggle_test: RGB_1  state == OFF
0000004193 [app] INFO: toggle_test: RGB_2  state == ON
0000004708 [app] INFO: toggle_test: RGB_2  state == OFF
0000004723 [app] INFO: ### Enter BRIGHTNESS Test ###
0000004840 [app] INFO: brightness_test: brightness == 10
0000004957 [app] INFO: brightness_test: brightness == 20
0000005074 [app] INFO: brightness_test: brightness == 30
0000005191 [app] INFO: brightness_test: brightness == 40
0000005308 [app] INFO: brightness_test: brightness == 50
0000005425 [app] INFO: brightness_test: brightness == 60
0000005542 [app] INFO: brightness_test: brightness == 70
0000005659 [app] INFO: brightness_test: brightness == 80
0000005776 [app] INFO: brightness_test: brightness == 90
0000005893 [app] INFO: brightness_test: brightness == 100
0000006010 [app] INFO: brightness_test: brightness == 110
0000006127 [app] INFO: brightness_test: brightness == 120
0000006244 [app] INFO: brightness_test: brightness == 130
0000006361 [app] INFO: brightness_test: brightness == 140
0000006478 [app] INFO: brightness_test: brightness == 150
0000006595 [app] INFO: brightness_test: brightness == 160
0000006712 [app] INFO: brightness_test: brightness == 170
0000006829 [app] INFO: brightness_test: brightness == 180
0000006946 [app] INFO: brightness_test: brightness == 190
0000007063 [app] INFO: brightness_test: brightness == 200
0000007180 [app] INFO: brightness_test: brightness == 210
0000007297 [app] INFO: brightness_test: brightness == 220
0000007414 [app] INFO: brightness_test: brightness == 230
0000007531 [app] INFO: brightness_test: brightness == 240
0000007648 [app] INFO: brightness_test: brightness == 250
0000007664 [app] INFO: ### Enter SPEED PATTERN Test ###
0000007718 [app] INFO: SPEED == 10
0000012728 [app] INFO: speed_pattern_test: SPEED == 20
0000017754 [app] INFO: speed_pattern_test: SPEED == 30
0000022780 [app] INFO: ### Enter COLOR Test ###
0000022818 [app] INFO: color_test: Red == 010,Green == 000,Blue == 000
0000022938 [app] INFO: color_test: Red == 020,Green == 000,Blue == 000
0000023059 [app] INFO: color_test: Red == 030,Green == 000,Blue == 000
0000023179 [app] INFO: color_test: Red == 040,Green == 000,Blue == 000
0000023300 [app] INFO: color_test: Red == 050,Green == 000,Blue == 000
0000023420 [app] INFO: color_test: Red == 060,Green == 000,Blue == 000
0000023540 [app] INFO: color_test: Red == 070,Green == 000,Blue == 000
0000023660 [app] INFO: color_test: Red == 080,Green == 000,Blue == 000
0000023780 [app] INFO: color_test: Red == 090,Green == 000,Blue == 000
0000023900 [app] INFO: color_test: Red == 100,Green == 000,Blue == 000
0000024020 [app] INFO: color_test: Red == 110,Green == 000,Blue == 000
0000024141 [app] INFO: color_test: Red == 120,Green == 000,Blue == 000
0000024261 [app] INFO: color_test: Red == 130,Green == 000,Blue == 000
0000024381 [app] INFO: color_test: Red == 140,Green == 000,Blue == 000
0000024502 [app] INFO: color_test: Red == 150,Green == 000,Blue == 000
0000024622 [app] INFO: color_test: Red == 160,Green == 000,Blue == 000
0000024743 [app] INFO: color_test: Red == 170,Green == 000,Blue == 000
0000024864 [app] INFO: color_test: Red == 180,Green == 000,Blue == 000
0000024985 [app] INFO: color_test: Red == 190,Green == 000,Blue == 000
0000025105 [app] INFO: color_test: Red == 200,Green == 000,Blue == 000
0000025225 [app] INFO: color_test: Red == 210,Green == 000,Blue == 000
0000025346 [app] INFO: color_test: Red == 220,Green == 000,Blue == 000
0000025467 [app] INFO: color_test: Red == 230,Green == 000,Blue == 000
0000025588 [app] INFO: color_test: Red == 240,Green == 000,Blue == 000
0000025709 [app] INFO: color_test: Red == 250,Green == 000,Blue == 000
0000025829 [app] INFO: color_test: Red == 000,Green == 010,Blue == 000
0000025949 [app] INFO: color_test: Red == 000,Green == 020,Blue == 000
0000026069 [app] INFO: color_test: Red == 000,Green == 030,Blue == 000
0000026190 [app] INFO: color_test: Red == 000,Green == 040,Blue == 000
0000026311 [app] INFO: color_test: Red == 000,Green == 050,Blue == 000
0000026431 [app] INFO: color_test: Red == 000,Green == 060,Blue == 000
0000026552 [app] INFO: color_test: Red == 000,Green == 070,Blue == 000
0000026673 [app] INFO: color_test: Red == 000,Green == 080,Blue == 000
0000026794 [app] INFO: color_test: Red == 000,Green == 090,Blue == 000
0000026915 [app] INFO: color_test: Red == 000,Green == 100,Blue == 000
0000027036 [app] INFO: color_test: Red == 000,Green == 110,Blue == 000
0000027156 [app] INFO: color_test: Red == 000,Green == 120,Blue == 000
0000027276 [app] INFO: color_test: Red == 000,Green == 130,Blue == 000
0000027396 [app] INFO: color_test: Red == 000,Green == 140,Blue == 000
0000027516 [app] INFO: color_test: Red == 000,Green == 150,Blue == 000
0000027636 [app] INFO: color_test: Red == 000,Green == 160,Blue == 000
0000027757 [app] INFO: color_test: Red == 000,Green == 170,Blue == 000
0000027878 [app] INFO: color_test: Red == 000,Green == 180,Blue == 000
0000027998 [app] INFO: color_test: Red == 000,Green == 190,Blue == 000
0000028118 [app] INFO: color_test: Red == 000,Green == 200,Blue == 000
0000028239 [app] INFO: color_test: Red == 000,Green == 210,Blue == 000
0000028359 [app] INFO: color_test: Red == 000,Green == 220,Blue == 000
0000028479 [app] INFO: color_test: Red == 000,Green == 230,Blue == 000
0000028599 [app] INFO: color_test: Red == 000,Green == 240,Blue == 000
0000028718 [app] INFO: color_test: Red == 000,Green == 250,Blue == 000
0000028838 [app] INFO: color_test: Red == 000,Green == 000,Blue == 010
0000028958 [app] INFO: color_test: Red == 000,Green == 000,Blue == 020
0000029079 [app] INFO: color_test: Red == 000,Green == 000,Blue == 030
0000029200 [app] INFO: color_test: Red == 000,Green == 000,Blue == 040
0000029320 [app] INFO: color_test: Red == 000,Green == 000,Blue == 050
0000029440 [app] INFO: color_test: Red == 000,Green == 000,Blue == 060
0000029561 [app] INFO: color_test: Red == 000,Green == 000,Blue == 070
0000029681 [app] INFO: color_test: Red == 000,Green == 000,Blue == 080
0000029801 [app] INFO: color_test: Red == 000,Green == 000,Blue == 090
0000029921 [app] INFO: color_test: Red == 000,Green == 000,Blue == 100
0000030042 [app] INFO: color_test: Red == 000,Green == 000,Blue == 110
0000030162 [app] INFO: color_test: Red == 000,Green == 000,Blue == 120
0000030283 [app] INFO: color_test: Red == 000,Green == 000,Blue == 130
0000030403 [app] INFO: color_test: Red == 000,Green == 000,Blue == 140
0000030523 [app] INFO: color_test: Red == 000,Green == 000,Blue == 150
0000030644 [app] INFO: color_test: Red == 000,Green == 000,Blue == 160
0000030765 [app] INFO: color_test: Red == 000,Green == 000,Blue == 170
0000030886 [app] INFO: color_test: Red == 000,Green == 000,Blue == 180
0000031006 [app] INFO: color_test: Red == 000,Green == 000,Blue == 190
0000031126 [app] INFO: color_test: Red == 000,Green == 000,Blue == 200
0000031246 [app] INFO: color_test: Red == 000,Green == 000,Blue == 210
0000031366 [app] INFO: color_test: Red == 000,Green == 000,Blue == 220
0000031487 [app] INFO: color_test: Red == 000,Green == 000,Blue == 230
0000031608 [app] INFO: color_test: Red == 000,Green == 000,Blue == 240
0000031728 [app] INFO: color_test: Red == 000,Green == 000,Blue == 250
0000031849 [app] INFO: color_test: Red == 247,Green == 165,Blue == 206
0000031969 [app] INFO: color_test: Red == 096,Green == 122,Blue == 110
0000032090 [app] INFO: color_test: Red == 042,Green == 033,Blue == 109
0000032208 [app] INFO: color_test: Red == 064,Green == 226,Blue == 203
0000032328 [app] INFO: color_test: Red == 174,Green == 019,Blue == 146
0000032448 [app] INFO: color_test: Red == 215,Green == 019,Blue == 007
0000032569 [app] INFO: color_test: Red == 145,Green == 163,Blue == 100
0000032690 [app] INFO: color_test: Red == 046,Green == 114,Blue == 098
0000032810 [app] INFO: color_test: Red == 108,Green == 098,Blue == 178
0000032930 [app] INFO: color_test: Red == 234,Green == 248,Blue == 085
0000033050 [app] INFO: color_test: Red == 174,Green == 119,Blue == 180
0000033171 [app] INFO: color_test: Red == 026,Green == 241,Blue == 129
0000033292 [app] INFO: color_test: Red == 054,Green == 206,Blue == 184
0000033413 [app] INFO: color_test: Red == 067,Green == 172,Blue == 074
0000033534 [app] INFO: color_test: Red == 116,Green == 190,Blue == 159

But the lights on the M1-Enclosure never do anything. Any other thoughts?

Make sure you've enabled 3V3_AUX on the Muon.

This is the LED circuit on the M1 Enclosure adapter board:

LED4 is the LED at the top. LED5 and LED6 are the user buttons.

This is different than the Monitor One:

However since the test program tests all three possible RGB LEDs, that's probably not the issue.

Thanks for the help on this! That took care of it.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.