Jump to content

Recommended Posts

Posted

Hey people,

Maybe you can guide me in the right direction. 

In my projects I use buttons with integrated LEDs. But I want to get away from the standard HC595. Mainly because it takes a lot of PCB space and it has a lot traces due to the SPI protocol. 

Is there another style to control those LEDs? I also work a lot with WS2812. This is great because there is only one single data line from one to the next. 

Thanks,

Chris

Posted
On 05/11/2019 at 10:12 AM, FantomXR said:

In my projects I use buttons with integrated LEDs.

13 hours ago, latigid on said:

Does an LED matrix with multiplexing go far enough?

Yep BLM! Multiplexing will limit the number of 595/165.


 

  • 3 weeks later...
Posted

Alright... I've got a solution that works great for me. I thought I share it with you.

I now tried WS2811 driver ICs. They are cheap and only need one data-line which goes from one IC to the next. Each IC can drive three LEDs. Of course you are not really capable to control them individually with standard NG code. So I've added a meta command.

Add this to mbng_event.c (row 2968 and following):
 

  case MBNG_EVENT_META_TYPE_RGB_LED_SET_SINGLE:      return "RgbLedSetSingle";

row 3055 and following:

  if( strcasecmp(meta_type, "RgbLedSetSingle") == 0 )       return MBNG_EVENT_META_TYPE_RGB_LED_SET_SINGLE;

row 3142 and following:

  case MBNG_EVENT_META_TYPE_RGB_LED_SET_SINGLE:     return 3;

row 3376 and following:


    case MBNG_EVENT_META_TYPE_RGB_LED_SET_SINGLE: {
      u16 led;
      if( (led=meta_values[0]) ) {
	led -= 1;
	WS2812_LED_SetRGB(led, meta_values[1], meta_values[2]);
      }
    } break;

 

in mbng_event.h add this line 163 and following:

  MBNG_EVENT_META_TYPE_RGB_LED_SET_SINGLE,

 

Done! Now you can call the meta RGBLEDSETSINGLE from NG. Here is a quick example. I had no buttons connected to that midibox. So I've worked with receivers and senders:

EVENT_RECEIVER id=1 type=cc cc=2 if_equal=127 fwd_id=SENDER:1
EVENT_RECEIVER id=1 type=cc cc=2 if_equal=0   fwd_id=SENDER:2

EVENT_SENDER id=1 type=meta meta=rgbledsetsingle:1:1:255
EVENT_SENDER id=2 type=meta meta=rgbledsetsingle:1:1:0

This switches on the second LED of the first IC on if CC2 with a value of 127 is received. It switches off when 0 is received. 

So you can control each LED individually without overwriting the other :-)
 

Posted

Interesting solution! Do you use the tiny ICs or SOIC ones? Did you use a power supply resistor for each?

The bonus with WS2811s is you can get better dimming effects than with SRIO scan (and dimming is practically unusable in a matrix).

Posted
Just now, Antichambre said:

Can be interesting to see if we can combine/sync this chip with SRIO(HC595) to get matrix with dimming, without to much ghost artefact.

Tried it! The LEDs flicker/pulse rather than dimming as the PWM/clock rates are not syncronised...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...