Show Posts
Pages: 1 [2] 3 4 ... 6
16  Using Arduino / LEDs and Multiplexing / Re: ShiftPWM support topic. Latest update: Support not using the SPI on: May 29, 2012, 08:12:36 am

They are basically two LED's in one case, so yes. They share a cathode or anode, but you would just tie that to ground/vcc and use PWM for the other pin.
17  Using Arduino / LEDs and Multiplexing / Re: ShiftPWM support topic. Latest update: Support not using the SPI on: May 29, 2012, 08:10:16 am
... stuff about shrinking and high power

I have not used ShiftPWM with an attiny. As far as I know there are no AtTiny arduino clones. The code uses some Arduino functions, so it will not be directly compatible. Maybe you could have a look at the teensy 2.0? www.prjc.com/teensy. It is really small and arduino compatible.

My high power led drivers are meant to drive high power, luxeon type, LED's without resistors. You are using LED strips, which have resistors on them. You are better off using transistors to switch them. I will design a transistor board for ShiftPWM, but it is not available now.
18  Using Arduino / LEDs and Multiplexing / Re: ShiftPWM support topic. Latest update: Support not using the SPI on: May 29, 2012, 08:05:00 am
Is there a colour cross-fading (or morphing) effect in ShiftPWM for RGB leds?
-to change from blue to green smoothly.

Will my code work for RGB leds to simply set it's brightness without affecting it's current colour?
for example that led1 is set to keep on changing from green to blue then back to green, then with my code i just make its brightness dimmer without affecting the colour changing?
Or is there a function in SHiftPWM to do this?

There are functions to set HSV values. With the hue you can smoothly go from blue to green. With the value you can change the brightness.
19  Using Arduino / LEDs and Multiplexing / Re: ShiftPWM support topic. Latest update: Support not using the SPI on: May 26, 2012, 11:53:22 am
Try something like this:

Code:
unsigned long elapsed=millis();
if(elapsed>1000 && elapsed < 2000){
   unsigned char j = elapsed>>2; // shift right 2 to divide by 4.
   ShiftPWM.SetOne(0 ,j);
}

Of course this will go to 250 instead of 255, but it is a very fast calculation.
20  Using Arduino / LEDs and Multiplexing / Re: ShiftPWM support topic. Latest update: Support not using the SPI on: May 10, 2012, 04:24:13 pm
I believe the OE pin sets the outputs in a high impedance state. It does not disable input from the data line at every clock pulse.
The 595 is not a true SPI device. The 595 does not have a slave select input and just clocks in at every clock pulse as far as I know.
To prevent the leds from getting corrupted, you would have to block the clock line.

What you might be able to do is modify the library. In a SPI port, clocking bits out and clocking bits in is simultaneous. The MISO pin (pin 12 on a regular arduino) is shifted in. My library just discards that data, but you might be able to use it.

But why bother and not just use 3 regular pins?

I don't use the SPI for switching between rows, because it doesn't have to happen often. For every 255 brightness levels, I just have to give the row register 1 clock pulse to go to the next row (=1shift). I also don't even have to send out a full byte. Just one pulse on the clock line and writing a 1 to the data line to switch back to the first row.
21  Using Arduino / LEDs and Multiplexing / Re: ShiftPWM support topic. Latest update: Support for different setups than RGBRGB on: May 09, 2012, 04:59:39 pm
I am not sure what you are mean by your question but I did upload a new version, with support for not using the SPI port!
It is about 2.5x slower, but it lets you freely choose the pins. New version:

* Download it here:
https://github.com/elcojacobs/ShiftPWM/downloads
* Extract it to libraries/ShiftPWM
* Open one of the examples

I think I would prefer to use the SPI for the LED's and use ShiftIn (http://arduino.cc/en/Reference/ShiftIn) for the inputs.
22  Using Arduino / LEDs and Multiplexing / Re: ShiftPWM support topic. Latest update: ShiftMatrixPWM needs testing on: May 07, 2012, 06:22:44 pm
All right, next update is online. I created a new branch, called pinFlexibily. After testing I will merge it with the master branch.
You can find it here:
https://github.com/elcojacobs/ShiftPWM/tree/PinFlexibility

This update introduces two new things:

Offset
An optional argument to all functions that set one led/group, called offset. When would you use this?
Say you have 2 boards, each with 4 shift registers and 10 RGB LED's. That means that you have 2 empty outputs on your board.

The second board would be misaligned because of this gap. You can now use ShiftPWM.SetRGB(lednr, r,g,b,2) for the second board to correct this. You can still use SetRGB(lednr, r,g,b), because offset defaults to 0.

Pin Grouping
With the function ShiftPWM.SetPinGrouping(int grouping), you can now set how your pins are grouped together by color.
If your LED's are connected like this: RRRR-GGGG-BBBB-RRRR-GGGG-BBBB.. you can use SetPinGrouping(4).
SetRGB(5,255,0,255) will set output 13 and 21 to 255. (remember counting starts at 0).

I would appreciate some feedback before I merge this into the main branch.

Next up, in order: better documentation, bit code modulation instead of PWM, debugging the Matrix version.
23  Using Arduino / LEDs and Multiplexing / Re: ShiftPWM support topic. Latest update: ShiftMatrixPWM needs testing on: May 06, 2012, 04:51:47 pm
Those variables are constant for a good reason: speed.
When they are constant, the compiler can optimize the if statements away.

The invert variable is only meant to adjust the library for common anode or common cathode LED's.

I have started updating the code. So far I have integrated the RGB and HSV functions and added some more examples (HSV fading, random colors, and a fake VU meter). Next up is support for different setups than RGBRGBRGB and support for gaps (unused pins in between).

Follow along at:
https://github.com/elcojacobs/ShiftPWM
24  Using Arduino / LEDs and Multiplexing / Re: ShiftPWM support topic. Latest update: ShiftMatrixPWM needs testing on: May 05, 2012, 07:02:55 am
Easier to use RGB and HSV functions, flexibility in LED setup, memory optimizations, possibility to use BCM instead of PWM (more speed and levels at the cost of double memory usage).

I also want to move everything to GitHub to make user contributions easier.

But I also have brewing to do today, so I will probably not get this all done today.
25  Using Arduino / LEDs and Multiplexing / Re: SoftPWM + ShiftPWM on: May 04, 2012, 07:53:53 am
Something about non block led stuff..

Tomorrow is brew day en ShiftPWM day.
I am aware that the documentation is very minimal. It will receive a big update soon, because I am going to sell high power led drivers for ShiftPWM.

It seems to me that your problem is not that hard. For nonblocking, something like this, with the millis() function. This is untested code, because I am at work now.

Example for one led: fadein 1 sec, fadeout 1 sec, off 5 sec.
Code:
void setup(){
   timerstart=millis();
}

void loop(){
   unsigned long timer=millis();
   unsigned long elapsed = timer - timerstart;
   if(elapsed > 7000){
       timerstart=millis();
       elapsed = 0;
   }
   if(elapsed)< 1000){
       ShiftPWM.setOne(1, maxBrightness*elapsed/1000);
   }
   else if(elapsed < 2000){
       ShiftPWM.setOne(1, maxBrightness - maxBrightness*elapsed/1000);
   }
   else{
       ShiftPWM.setOne(1,0);
  }

  /* do other stuff here */

}

Billieblaze, your question is a bit more complicated and I don't have time to answer it now in detail. I believe the current version of matrix pwm is RGBRGBRGB... and not R..RRG..GGB..BB. But the led driver board I designed myself uses the same setup as you have, so I will create a new version with that setup, but I am overloaded with work so I cannot promise you when.
26  Using Arduino / LEDs and Multiplexing / Re: ShiftPWM support topic. Latest update: ShiftMatrixPWM needs testing on: February 06, 2012, 07:05:45 am
If you are using the hsv2rgb function, value is the brightness.
You could also use series resistors to permanently reduce the brightness.
27  Using Arduino / LEDs and Multiplexing / Re: ShiftPWM support topic. Latest update: ShiftMatrixPWM needs testing on: January 31, 2012, 05:47:16 pm
I will give the matrix version a big update soon, because my matrix driver boards will arrive this week.
7x20x3 is not that big, my test now will be 8x24x3 and I will later scale it up to 24x24x3.

My leds will run on 40mA, because that is what the datasheet says they can handle as peak current. scaling to 80 will be no problem. You do have to take into account that your row transistors are capable of switching 20x3x80mA. That is a lot, so you might want to split that up per color or per group of LED's. For a power supply, PC power supply's are great. Just add a bunch of big capacitors.

You also want to protect your circuit against the situation where your Arduino is not switching rows. Your peak current would become a continuous current and blow up your LED's. My protection circuit is in the alpha test phase...

The calculation for matrices is the same as for one big chain, so I will refer to the formula on my website. I will look into BCM for the matrix version, which could increase the number of brightness levels.
28  Using Arduino / LEDs and Multiplexing / Re: ShiftPWM support topic. Latest update: ShiftMatrixPWM needs testing on: January 24, 2012, 07:10:00 am
Hi Paul,

I sent you an e-mail about the Teensy 12 days ago, you must have missed it.
I have ordered a Teensy++ to develop the matrix code, so Teensy support will be taken care of.

Elco
29  Using Arduino / LEDs and Multiplexing / Re: ShiftPWM support topic. Latest update: ShiftMatrixPWM needs testing on: January 11, 2012, 01:25:00 pm


This works, even with a 1 microsecond pulse smiley Boards will be sent to Laen tonight.

Edit: Okay, it almost works. It can get in a stuck in a state where the SCR is half open and the capacitor stays at 1.25V. The drain of the BS250 stays at 0.68V in that case. Suggestions to fix this are welcome.

Edit2: Fixed with a resistor from the SCR gate to ground smiley Boards will go to Laen today!
30  Using Arduino / LEDs and Multiplexing / Re: ShiftPWM support topic. Latest update: ShiftMatrixPWM needs testing on: January 07, 2012, 08:36:50 am
Hmm, maybe the current pulse is too short to trigger the SCR?

I'll buy some logic level SCR's and have a go at it myself as well.
Pages: 1 [2] 3 4 ... 6