Control two-color leds with one pin? Any ways to maximize use of gpios/add more gpios?


#21

Does it work on two pin bicolor leds?

How would this be done? I have red-green bicolored leds and Im really interested in this possibility.


#22

For 1 bicolor 2-pin led using two gpio's, you can connect: one gpio to a resistor to the led to a 2nd gpio, all in series.
To control it, you use two gpio/out/digital objects (mode: push-pull).
Connect ctrl/toggle objects to the gpio/out/digital objects and you'll find out how it works.

For 3 bicolor 2-pin leds on 3 gpio's things become more complicated: This link explains it.
On a second thought you will need a custom object, since there are no objects that can change a gpio between (high-)Z, High and Low, dynamically.
I kindly invite the community to create an object for driving 3 charlieplexed bicolor leds.


#23

Im really excited about this. Im just not experienced at all with all this electric expertise language and schematics. I think I need somekind of simple version of that link.. Depends a lot how complicated this procedure is if Im able to do it. But Im gonna try to learn it!

Thanks!


#24

I finally got to try the leds with axoloti. Soldering and electronics seem not to be so hard, leds are probably the easiest things in electronics though :). I got the bicolored leds light up red and green. Do I need to connect VDD to leds also? It is recommended in axoloti- starter guide book to use VDD in complex circuits. Im not sure how to do that. And should I divide the GROUND sl I can use the same connection in multiple components? How to divide it? Also I soldered header pins to axoloti holes. And got the breadboard testing started. Everything is working so far :smiley: awesome. How do i solder the components to the header pins after im done prototyping? They seem to be so close to each other, that soldering might connect them to each other :confused:

Cant wait to try this out :slight_smile:


#25

I know that this was already answered, but I wanted to add this:
Whenever you see an LED being dimmed below its maximum brightness, it's being switched on and off hundreds or thousands of times per second using PWM (pulse width modulation). Even though it appears to be constant, it's really switching super fast.
Of course, there are circuits that can dim an LED by reducing the current, but those are far less common than the PWM method.


#26

Thanks for enlightening!


#27

Is this how hard to do for someone who knows what hes doing?
Does this help?


They got the code for charlieplexing leds for arduino. Can the same code be used with axoloti


#28

I started to work on this some time ago, I did stop, but there were 2 reasons for it.
I wanted to hook up 16 led's.

1stly, started looking into building the objects in the Patcher, I found it cumbersome and was somewhat concerned about the eventual % of processing it would take up, the more I did, the bigger it got. I am sure there are more efficient means of doing this, but efficiency and needs are always at the top of my list.
2ndly, After stopping the 1st part, I decided to use an arduino which I would send data from the Axo too via serial out, this is much easier to do, and the arduino has several pre-built libraries to use so this was going to be a piece of cake, and worked perfectly, and so I also thought to increase my LED's from 16 to 32 so would need to redo all the wiring. Started working on the parts, wiring etc, then I realized how far away I was getting from the final goal with all this extra work, and considering I was using a VGA monitor to display lots of data, I decided to do away with the LED's altogether. On an efficiency side, not sure if a charlieplexing object is worth it unless your demands are low, but maybe those a bit more in the know may have a better understanding. :grin:


#29

Charlieplexing is quite clever when saving money is the top priority... and performance is the least concern.

However, if performance is even a slight concern then I'd recommend spending a little more money on the circuit so that the CPU has less work to do. In the case of Axoloti, I'd think that you'd want as much CPU available for audio as possible. I'm talking even just a few dollars can save lots of CPU power compared to Charlieplexing.

You can add decoder chips to expand two, three, or four I/O pins into four, eight, or sixteen columns. Then you can put as many rows of LEDs on each column as you like with the remaining I/O pins, using transistor drivers or other boost circuits to bump up the current for more brightness. There are also many LED driver chips that interface via serial links, and these might be cheaper than adding an Arduino - although designing a custom circuit might take way more time.

I think Gavin ended up making the right choice. Make sure you know what you really need and then devote the appropriate amount of resources to that end. Not everyone has a project that would benefit from a VGA monitor, but it's still important to know how many LEDs you actually want on your audio pedal before deciding what kind of circuit.

As for the software, it should not be difficult to add LED support even if it requires custom code.