Show Posts
Pages: [1] 2
1  Using Arduino / General Electronics / Re: WS2803 example on: January 14, 2013, 04:41:29 pm
It still doesn't work, tried three WS2803's.

I connected everything and tried the following code:
Code:
// 8 CLK
const int pinCLK = 5 ;

// 9 CLK Data
const int pinDATA = 6 ;


void setup() {
    Serial.begin( 57600 );  
  pinMode(pinCLK, OUTPUT);
  pinMode(pinDATA, OUTPUT);

  digitalWrite(pinCLK, HIGH);
  digitalWrite(pinDATA, LOW);
}

byte val = 0 ;

void loop () {

  byte c;
  int digit;
  
  delayMicroseconds( 600 );

  val+= 2 ;
  
  for (c= 0 ; c<= 17 ;c++) {
    for (digit= 7 ;digit >= 0 ;digit--) {
    if (val & ( 1 << digit)) {
       digitalWrite(pinDATA, HIGH);
    } else {
     digitalWrite(pinDATA,LOW);
    }
    digitalWrite(pinCLK, HIGH);
    digitalWrite(pinCLK, LOW);
    }
  }

}
2  Using Arduino / General Electronics / Re: WS2803 example on: January 08, 2013, 06:23:38 am
I think I'm having a small problem.
All the schematics don't use a Arduino Leonardo, so I can't find the exact pins to connect the CKI and SDI to.
3  Using Arduino / General Electronics / Re: WS2803 example on: January 07, 2013, 02:34:04 pm
The number of outputs used has nothing to do with the value of IREF.

It becomes more clearer and clearer to me.

I just found the following, and I think I'm understanding it.

Quote
The datasheet shows Amps = 1.25 / Ohms * 22.  Some simple algebra gets:

Amps / 22 = 1.25 / Ohms

22 / Amps = Ohms / 1.25

(22 / Amps) * 1.25 = Ohms

For example: 20 mA -> (22 / 0.020) * 1.25 = 1375 Ohms

Current running through parts in series is the same.  So if you have 2 parts in series, their current is both 20mA.  If you have 100 in series, their current is still 20mA.

So 3 leds in series also use a total of 20mA.
4  Using Arduino / General Electronics / Re: WS2803 example on: January 07, 2013, 02:11:57 pm
Quote
But I don't really get the function of the cap.
It's a decoupling capacitor.  All devices should have them.

Ok, that something I will have to lookup.

Quote
And I can't really find what the 12V 5050 RGB SMD led's will use per three, to calculate the value of the IREF resistor.
You don't calculate for all 3.  You are setting the maximum for any of the output channels.  As for the value of to use, that's something you need to decide.  Determine what the maximum current the LEDs you are using can handle and then decide what you want your driver's maximum to be set at.

I'm trying to understand it.
I have 18 outputs on my WS2803, and all of these outputs are going to send a R, G or B signal to series of three.
Let's say the led's use 20mA each, so a series of three will use 60mA over each channel.
How do I then determine which resistor I will be needing for IREF?

5  Using Arduino / General Electronics / Re: WS2803 example on: January 07, 2013, 01:49:00 pm
Do I need to add resistors or capacitators?

I saw the following schematic :


But I don't really get the function of the cap. And I can't really find what the 12V 5050 RGB SMD led's will use per three, to calculate the value of the IREF resistor.
6  Using Arduino / General Electronics / Re: WS2803 example on: January 07, 2013, 11:38:56 am
Thanks for your reply.

Is there anyone who could help me with connecting my WS2803?
Can't find any real answers, and most topics seem almost dead to me.
7  Using Arduino / LEDs and Multiplexing / Re: Newbie ambilight question on: January 03, 2013, 01:56:01 pm
Still waiting for the resistors from China. Had to order new ones.

Did a quick sketch of what I was meaning to do.
8  Using Arduino / LEDs and Multiplexing / Re: WS2803 versus WS2801 on: January 02, 2013, 03:52:20 pm
The comments below are from initial testing only and are subject to change based on feedback.

Findings:
The 144 bit requirement means this chip needs to be fed in full 18 LED values.  So if you have 52 LEDs, you have to say 54 LEDs in the setup and then just turn the last two off in your code if using the old library.  I created a version of the single library that buffers the last part automatically allowing you to use 52 in your code.  

Other notes:
The data does not go into the chips the say way.  The order of the ports is normal 0 through 17 but the data is sent to each chip backwards.  So if you have three chips, the first chip data should be chip 3 and the final chip data should be chip 1.   An updated version of the library attached below - replacing the old one.

Updated Library:
Attached is the WS2803Single library:
Update 1) This version will buffer the difference if an increment of 18 LEDs is not used. Note that when you use numPixels() it will return the new LED count, not the value passed in. So if you start with 37 - it is buffered to 54 .. so numPixels() will return 54.  In your code you can simply use the same value originally instantiated .. just do not rely on the numPixels method for this unless you want to include buffered LEDs not attached in your patterns.
  
Update 2) This library sends the data in the correct order (chips backwards - ports forward).  This should make using the original library for WS2801 .. the singleWS2801 and this library work with no other change needed in the code outside the class and library names. Tested both SPI and bigbang methods.



I'm trying to get your code to work, but I get the following messages:

strandtest:28: error: 'WS2803Single' does not name a type
strandtest.ino: In function 'void setup()':
strandtest:31: error: 'strip' was not declared in this scope
strandtest.ino: In function 'void loop()':
strandtest:43: error: 'strip' was not declared in this scope
strandtest:45: error: 'strip' was not declared in this scope
strandtest:47: error: 'strip' was not declared in this scope
strandtest:54: error: 'strip' was not declared in this scope
9  Using Arduino / General Electronics / WS2803 example on: January 02, 2013, 10:57:55 am
Does someone have a working piece of code that I can try with my WS2803?
I want to use it with a led string, but I can only find code for the WS2801.

Thanks!
10  Using Arduino / General Electronics / Re: Multi value resistors on: July 17, 2012, 11:28:04 am
I'm asking if this is possible or if this is fake, never seen it before.
Sorry to say that you didn't answer my question by only replying yes.

So can I use these : 50 Value 1/4W Metal Film Resistors Assortment Kit (1R~10MR)
for all my purposes, or are single value resistors recommended?
11  Using Arduino / General Electronics / Multi value resistors on: July 17, 2012, 11:17:21 am
I bought some resistors and thought I would get a lot of 50 different values.
But now I got a lot of 50 value resistors? Is this possible or is this fake?
12  Using Arduino / Installation & Troubleshooting / Re: Help with Leonardo on: July 05, 2012, 04:08:00 pm
I build my setup just like the schematics.
But it also sends the commands to my Mac even when I don't have a setup and only the Leonardo connected and running the code. This is not normal in my opinion, but then again, I just started with Arduino.
13  Using Arduino / Installation & Troubleshooting / Re: Help with Leonardo on: July 05, 2012, 03:41:34 pm
You are missing a lot of the code that you need. 

Where are you getting the code from?  Please supply a link.

That would be funny smiley-razz.

http://arduino.cc/en/Tutorial/KeyboardMessage
14  Using Arduino / Installation & Troubleshooting / Help with Leonardo on: July 05, 2012, 01:47:39 pm
Hi all,

I just started with experimenting and trying out the code, etc.
But when I try to use a button or emulate a key it goes into a loop.
It keeps sendig the message.

I just used the standard available code:

Code:
const int buttonPin = 2;          // input pin for pushbutton
int previousButtonState = HIGH;   // for checking the state of a pushButton
int counter = 0;                  // button push counter

void setup() {
  // make the pushButton pin an input:
  pinMode(buttonPin, INPUT);
  // initialize control over the keyboard:
  Keyboard.begin();
}

void loop() {
  // read the pushbutton:
  int buttonState = digitalRead(buttonPin);
  // if the button state has changed,
  if ((buttonState != previousButtonState)
    // and it's currently pressed:
  && (buttonState == HIGH)) {
    // increment the button counter
    counter++;
    // type out a message
    Keyboard.print("You pressed the button ");
    Keyboard.print(counter);
    Keyboard.println(" times.");
  }
  // save the current button state for comparison next time:
  previousButtonState = buttonState;
}
15  Using Arduino / LEDs and Multiplexing / Re: Newbie ambilight question on: July 05, 2012, 10:44:44 am
Still waiting for some of the parts.

Recieved the following:
- 12V 2A power adapter
- PCB Breadboard with jumpwire
- 10pcs WS2803D
- Electrolytic Capacitors 10uF 16V

Hope to receive the rest next week.
Pages: [1] 2