Show Posts
Pages: [1]
1  Using Arduino / LEDs and Multiplexing / LPD6803 RGB Strip and visualizing colors on the computer on: May 18, 2014, 01:29:17 am
This is long but I tried to provide all the detail I could..

I've been working with a LPD6803 RGB LED Strip and I've successfully got it working.  I eventually (after getting unpredictable results) figured out that it wants values of only 0-31 for each LED (as opposed to 0-255.)  Once I figured that out I received predictable results, but here is my dilemma (and an extra question.)

I want to convert these 0-31 RGB values to ones I could transmit to a computer and display the color on the computer screen as well (using processing.)  If I use 0-31 where it expects 0-255 I get weird results. If I multiply the 0-31 value by ~8.225 to try to convert it to a 0-255 value I also get weird results.  

I found a chart in the datasheet ( http://www.adafruit.com/datasheets/LPD6803.pdf   Page 10-11 ) that describes the input data (0-31) vs the duty cycle (0-256) so I figure this may be related.  Would I be on the right track if I was trying to use this chart to convert my values to something I could display when the input of 0-255 is expected?



My extra question (which I'm still trying to research on my own) is when I combine two colors, like equal red and green, I'm not getting a yellow that I'd expected.  I have to bump up Red quite a bit higher than Green before I get yellow. Could that be a result of how RGB works, or maybe the difference in the eye's sensitivities to color that I would need to account for?


Thanks
2  Using Arduino / General Electronics / Re: Reusing parts? on: September 26, 2013, 12:46:08 am
You probably won't have much luck with the WLAN module either.  About the only things you can really reuse from a laptop easily would be the battery and any individual components (connectors, mainly) -- the complete modules would be difficult or impossible
3  Using Arduino / General Electronics / Re: DC signal when AC is connected on: September 12, 2013, 12:58:17 am
Thank you.  This is all brain storming and I don't intend to do it in the near future.  I was working on another project and this popped in my mind, and I wondered how it could be done. You've given me some good reading material (which will give me more things to search for, too)

4  Using Arduino / General Electronics / DC signal when AC is connected on: September 12, 2013, 12:26:16 am
I've searched online but haven't had any luck finding this. I may not be looking with the right words.

Here's what I'm looking to do:

I have a light in my garage that uses AC (standard bulb)  When that light turns on, I want a pin on my arduino to return HIGH (or low, doesn't matter. as long as it returns the opposite when it is off.) I don't want to use a light sensor for this since it could be tricked or get false data from light through a window.

I guess it's kind of like the reverse of a relay that I'm used to.

Do components like this exist, and if so what are they called?
5  Using Arduino / LEDs and Multiplexing / Re: 8x8 RGB Matrix w/ TLC5940 on: September 08, 2013, 02:52:55 am
Thanks. That makes sense. After going over the coding in my head I think I'd be saving a component and a some pins, but adding a lot of complexity.  I'll stick with the shift register for now.
6  Using Arduino / LEDs and Multiplexing / 8x8 RGB Matrix w/ TLC5940 on: September 07, 2013, 08:06:03 pm
I have a 8x8 RGB common anode matrix that I'm looking to hook up with 2 TLC5940s for the cathodes.  I already have the ICs but I don't currently have an IC to drive the anodes.   I was looking into using a 74HC595 and 8 NPN transistors but while wiring I had a thought. I'm only going to be using 24 of the 2x TLC5940's 32 total outputs. Is there any reason I couldn't (or shouldn't) hook up 8 PNP transistors to the remaining 8 outputs and control the anodes that way?

I did some searching online, and couldn't find anything.

Thanks
7  Using Arduino / Programming Questions / Re: 8x8 Matrix and Loops on: January 18, 2013, 03:24:17 am
That actually helps a lot. I had to do some searching but was able to wrap my mind around how it all works. 

My only other question is in the line: int y = pattern  & 7;

In this case, was 7 chosen because we know that the first four bits would be zero and that would make sure that once we use 'AND' the first 4 bits would predictably be 0, in essence making it as if only 4 bits mattered?

Thanks again for all your help.
8  Using Arduino / Programming Questions / Re: 8x8 Matrix and Loops on: January 17, 2013, 03:50:25 am
Thank you for your responses. They're all of value to me because they are distinctly different, so I know I will find uses for them.

tobyb121:  That solution sounds good and is something I'll use. Maybe not for this one in particular, but it gave me ideas on something else.  I hadn't thought of it that way so I'll save that info in my "cheat sheet" for the future.

UKHeliBob: Thanks for the advice on the variables. To be honest, I threw this together kind of quickly to extract it from my larger project.  I was kind of lazy and just copy+pasted the same thing and edited what was needed. It makes sense to give them different names for both me and anyone else who reads it.  Your solution with that function does clean it up.  I'm also saving your example to use as needed.

lloyddean:  Your idea intrigues me the most.  I uploaded it straight to my arduino and the results matched what my longer example did but in so much less space. As you can probably tell, I'm a novice at programming (at least anything beyond VBA/VBScript and some old Delphi/pascal stuff.)  Where can I learn more about this method?  I've figured out that 0x00/0x01 etc refers to the individual LEDs and I could easily adapt that for future use, but I'd love to understand it. Especially the lines "int x = pattern >> 4;"  and "int y = pattern  & 7;" -- Is there a phrase I could search to learn more about how >> and & work?  I assume it is to extract the data from the 3rd & 4th characters/digits from that part of the array, but I'm not sure how it referring to them.  Also, did you manually come up with that pattern by imagining the matrix and the LED locations, or was there a  particular method you used?   [Edit: just found the >> refers to bitshifting, so I've been reading about it and messing with examples.  Is there anywhere you could point me that could explain why "pattern >> 4"  turns the value in the pattern of 0x43 to "4"? I know if I print that part of the pattern to serial it shows up as 67 but after shifting it then it shows 4. I do realize 0x43 is hex for 67, but I'm not sure how it changes to 4.  I'm not just fishing for the answer--  While I'd like the answer, I'd love to know what to search for so I can learn more about it.]

Thanks smiley
9  Using Arduino / Programming Questions / 8x8 Matrix and Loops on: January 14, 2013, 01:56:49 am
I'm working on a project where part of it uses an 8X8 led matrix. I'm using one I bought from Adafruit.

The pattern is on a video here (I had to use a piece of paper so the leds didn't cause distortion in the image): http://youtu.be/FGIAMo4Cw_c


I was wondering if anyone could give me any ideas on how I could shorten the code.  Right now it uses many For loops but I imagine there must be a way to do it in a very short amount of code.  This is just one pattern of many and I hope to use whatever advice I get and apply it towards them all.

Here's my code so far (separated out so it's just this matrix):

Code:
#include <Wire.h>
#include "Adafruit_LEDBackpack.h"
#include "Adafruit_GFX.h"

Adafruit_8x8matrix matrix = Adafruit_8x8matrix();

void setup() {
  Serial.begin(9600);
  Serial.println("8x8 Test");
  matrix.setBrightness(0);
  matrix.setRotation(1);
  matrix.begin(0x70);  // pass in the address
}

void loop() {
  matrix.clear();
 
  for (int x=0; x<=7; x++) {
    matrix.drawPixel(0,x, LED_ON);
    matrix.writeDisplay();
    delay(100);
  }
  for (int x=1; x<=7; x++) {
    matrix.drawPixel(x,7, LED_ON);
    matrix.writeDisplay();
    delay(100);
  }
  for (int x=6; x>=0; x--) {
    matrix.drawPixel(7,x, LED_ON);
    matrix.writeDisplay();
    delay(100);
  }
  for (int x=6; x>=1; x--) {
    matrix.drawPixel(x,0, LED_ON);
    matrix.writeDisplay();
    delay(100);
  }
//
  for (int x=1; x<=6; x++) {
    matrix.drawPixel(1,x, LED_ON);
    matrix.writeDisplay();
    delay(100);
  }
  for (int x=2; x<=5; x++) {
    matrix.drawPixel(x,6, LED_ON);
    matrix.writeDisplay();
    delay(100);
  }
  for (int x=6; x>=1; x--) {
    matrix.drawPixel(6,x, LED_ON);
    matrix.writeDisplay();
    delay(100);
  }
  for (int x=5; x>=2; x--) {
    matrix.drawPixel(x,1, LED_ON);
    matrix.writeDisplay();
    delay(100);
  }   
  //
  for (int x=2; x<=5; x++) {
    matrix.drawPixel(2,x, LED_ON);
    matrix.writeDisplay();
    delay(100);
  }
  for (int x=3; x<=4; x++) {
    matrix.drawPixel(x,5, LED_ON);
    matrix.writeDisplay();
    delay(100);
  }
  for (int x=5; x>=2; x--) {
    matrix.drawPixel(5,x, LED_ON);
    matrix.writeDisplay();
    delay(100);
  }
  for (int x=4; x>=3; x--) {
    matrix.drawPixel(x,2, LED_ON);
    matrix.writeDisplay();
    delay(100);
  }     
    matrix.drawPixel(3,3, LED_ON);
    matrix.writeDisplay();
    delay(100);
    matrix.drawPixel(3,4, LED_ON);
    matrix.writeDisplay();
    delay(100);
    matrix.drawPixel(4,4, LED_ON);
    matrix.writeDisplay();
    delay(100);
    matrix.drawPixel(4,3, LED_ON);
    matrix.writeDisplay();
  delay(500);

}

Any advice would be appreciated.
10  Using Arduino / General Electronics / Name of/source for generic/universal crimp pins & connector housings on: January 07, 2013, 12:50:38 am
I have a ratcheting crimper that is supposedly decent for making servo-type connectors.  I'm wondering if anyone could tell me the actual name of the crimp pins and housings to make servo-type connections.  Ideally I'd like to be able to just purchase a lot from ebay or something if available.

When researching online I found many different names, but they were usually for a particular manufacturer's connector (which sometimes seem to be keyed certain ways.)  I'm not trying to match a certain manufacturer, just make connectors that can connect to the headers I place on my boards (and keep the wire mess down.)

Is there a generic name for the crimp pins & housings for this type of thing?  I know I found a bunch of "DuPont" labeled things on ebay but I wasn't sure if that's right.


Thanks
11  Using Arduino / Project Guidance / Re: Help with ShiftOut Circuit on: January 01, 2013, 06:36:58 pm
Thank you.  You helped me narrow it down -- My shift register works, but my original circuit didn't. 

What I did was hook it up to my Diecimila (instead of my nano) and used jumper wires to pins 13, 11, and 10.  I then used your code. I was surprised.

I wanted to debug my circuit still, so I swapped the pinout to match the tutorial but still used my Diecimila instead of Nano and the tutorial code worked. 

There must be some difference (or something odd) on my Nano.  I know the pins work.  I'll need to mess with it more.


Thank you for your help, and I like the way your code uses SPI more than the tutorial's method.
12  Using Arduino / Project Guidance / Re: Help with ShiftOut Circuit on: January 01, 2013, 05:51:39 pm
The power bars are linked all across on this one. I just verified the ground from the chip's leg reaches the top-most ground and all applicable 5v points reach each other.
13  Using Arduino / Project Guidance / Help with ShiftOut Circuit on: January 01, 2013, 05:23:59 pm
Can someone please give me some advice on my circuit.

I have no experience with shift registers, so I'm doing the following tutorial:

http://arduino.cc/en/Tutorial/ShiftOut

I successfully built it, I thought, until I uploaded the program and it did nothing.  I tried both the first and second example programs on that tutorial.

The only thing I did differently was using a different value of resistors since I had my 150ohm handy from a prior project with the same LEDs.


I put pics here: http://imgur.com/a/xnCew  (sorry if some are a little blurry) The only thing missing is the power source (usb) since I needed better light to take the pics.

The datasheet for my exact chip NXP 74HCT595) is here: http://www.nxp.com/documents/data_sheet/74HC_HCT595.pdf


For basic troubleshooting I used my multimeter to test for continuity in all areas I would expect it, and checked for any shorts.  All of that seems solid.


Is there something simple I'm missing? Or are there any other good things (or simple circuits) I could test to make sure my chip is okay? It's brand new and I've never used it before.

Thanks
Pages: [1]