Show Posts
Pages: [1] 2
1  Using Arduino / LEDs and Multiplexing / Re: MAP FUNCTION AND LPD8806 on: February 04, 2013, 03:41:56 pm
hey Robtillart,

Seems that code is for a RGB LED, but Im using the LPD8806 strips.

Any ideas?
2  Using Arduino / LEDs and Multiplexing / Re: MAP FUNCTION AND LPD8806 on: January 30, 2013, 05:16:43 pm
How might one discern this? reload the library? What other code options do I have for achieving this fade effect? smiley-lol
3  Using Arduino / Microcontrollers / ARDUINO MICRO question on: January 30, 2013, 05:15:08 pm
Wassup forum!

I am trying to power a microcontroller and LED strip off of ONE BATTERY. The LED strip needs a clean 5 V and may use close to an amp, but never actually 1 Amp.  I have found some batteries for RC purposes that are 4.8 volts and I think would work for the strip, but the Micro needs more than that to run clean.

I would ideally like to replace the battery as needed, a connector on the micro could make for quick battery replacement.

If I put 4.8 to the Micro will it run correctly?

If I put 6 V or higher to the Micro, are there pins on the Micro that will deliver a clean 5 volts out, able to handle close to 1 amp?

It seems the Teensy is another option, but Im just more familiar with the Arduino environment.
Thanks for any insight.
4  Using Arduino / LEDs and Multiplexing / Re: MAP FUNCTION AND LPD8806 on: January 29, 2013, 10:26:45 pm
Thanks for the patience and insight John.

When I run the current code here is what happens:

Red fade to Blue  -abrupt jump to red fade to blue fade to red -abrupt jump to blue fade to red fade to blue -abupt jump to red fade to blue fade to red -abrupt jump to blue, it just keeps repeating.

I want a smooth fade, back and forth, like a sine wave. Thanks for any insight.

Here is my code:

#include "LPD8806.h"
#include "SPI.h"

// Example to control LPD8806-based RGB LED Modules in a strip

/*****************************************************************************/

// Number of RGB LEDs in strand:


int nLEDs = 4;

// Chose 2 pins for output; can be any valid output pins:
int dataPin  = 11;
int clockPin = 13;

// Red:
#define COLOR1_R 255
#define COLOR1_G 0
#define COLOR1_B 0
// Blue:
#define COLOR2_R 0
#define COLOR2_G 0
#define COLOR2_B 255

LPD8806 strip = LPD8806(4, dataPin, clockPin);

void setup() {
  // Start up the LED strip
  strip.begin();

  // Update the strip, to start they are all 'off'
  strip.show();
}

void loop() {
  int r,g,b;
  uint16_t i, j, k;
 
  for (j=0; j < 100; j++) {
    r = map(j, 0, 100, COLOR1_R, COLOR2_R);
    g = map(j, 0, 100, COLOR1_G, COLOR2_G);
    b = map(j, 0, 100, COLOR1_B, COLOR2_B);
   
    for (i=0; i < 4; i++) { 
      strip.setPixelColor(i,(strip.Color(r,g,b) ));
    } 
   
    strip.show();   // write all the pixels out
    delay(120);
  }

  for (k=0; k < 100; k++) {
    r = map(k, 0, 100, COLOR2_R, COLOR1_R);
    g = map(k, 0, 100, COLOR2_G, COLOR1_G);
    b = map(k, 0, 100, COLOR2_B, COLOR1_B);
   
    for (i=0; i < 4; i++) { 
      strip.setPixelColor(i,(strip.Color(r,g,b) ));
    } 
   strip.show();
    delay(120);
  }
}
5  Using Arduino / LEDs and Multiplexing / Re: MAP FUNCTION AND LPD8806 on: January 28, 2013, 09:08:29 pm
sorry, misplaced a j and k. still it skips when I run it
6  Using Arduino / LEDs and Multiplexing / Re: MAP FUNCTION AND LPD8806 on: January 28, 2013, 08:00:39 pm
thanks!

is it the extra space in the code, k not being defined properly?

The code for j does seem to give me a gradual fade. Why not k?

really appreciate the guidance
7  Using Arduino / LEDs and Multiplexing / MAP FUNCTION AND LPD8806 on: January 28, 2013, 04:46:25 pm
Hi, im trying to use the MAP function to gradually fade in-between colors. When I use this code it does the first fade, but then JUMPS back and does it over, without executing the second fade.

Any advice very appreciated, THANKS




#include "LPD8806.h"
#include "SPI.h"

// Example to control LPD8806-based RGB LED Modules in a strip

/*****************************************************************************/

// Number of RGB LEDs in strand:


int nLEDs = 4;

// Chose 2 pins for output; can be any valid output pins:
int dataPin  = 11;
int clockPin = 13;

// Magenta:
#define COLOR1_R 0
#define COLOR1_G 0
#define COLOR1_B 255
// Blue:
#define COLOR2_R 255
#define COLOR2_G 0
#define COLOR2_B 0

// First parameter is the number of LEDs in the strand.  The LED strips
// are 32 LEDs per meter but you can extend or cut the strip.  Next two
// parameters are SPI data and clock pins:
LPD8806 strip = LPD8806(4, dataPin, clockPin);

// You can optionally use hardware SPI for faster writes, just leave out
// the data and clock pin parameters.  But this does limit use to very
// specific pins on the Arduino.  For "classic" Arduinos (Uno, Duemilanove,
// etc.), data = pin 11, clock = pin 13.  For Arduino Mega, data = pin 51,
// clock = pin 52.  For 32u4 Breakout Board+ and Teensy, data = pin B2,
// clock = pin B1.  For Leonardo, this can ONLY be done on the ICSP pins.
//LPD8806 strip = LPD8806(nLEDs);

void setup() {
  // Start up the LED strip
  strip.begin();

  // Update the strip, to start they are all 'off'
  strip.show();
}

void loop() {
  int r,g,b;
  uint16_t i, j, k;
 
  for (j=0; j < 140; j++) {
    r = map(j, 0, 140, COLOR1_R, COLOR2_R);
    g = map(j, 0, 140, COLOR1_G, COLOR2_G);
    b = map(j, 0, 140, COLOR1_B, COLOR2_B);
   
    for (i=0; i < 4; i++) { 
      strip.setPixelColor(i,(strip.Color(r,g,b) ));
    } 
   
    strip.show();   // write all the pixels out
    delay(50);
  }

  for (k=0; k < 140; j++) {
    r = map(k, 0, 140, COLOR2_R, COLOR1_R);
    g = map(k, 0, 140, COLOR2_G, COLOR1_G);
    b = map(k, 0, 140, COLOR2_B, COLOR1_B);
   
    for (i=0; i < 4; i++) { 
      strip.setPixelColor(i,(strip.Color(r,g,b) ));
    } 
   
   strip.show();   // write all the pixels out
    delay(100);
  }
}
8  Using Arduino / LEDs and Multiplexing / LSR sketch on: January 02, 2013, 05:45:35 pm
Hello. I am going through the GETTING STARTED WITH ARDUINO book and there is an example using a Light Sensitive Resistor and inputing that info into an analog pin to vary an LED brightness.

When I do the sketch, the LED only varies slightly. I would like it to go all the way out and back up if possible.

Here is the code Im using, directly from the book:

// Example 06B: Set the brightness of LED to

// a brightness specified by the

// value of the analogue input

const int LED = 10;

int val = 0;

// the pin for the LED

// variable used to store the value

// coming from the sensor

void setup() {

pinMode(LED, OUTPUT); // LED is as an OUTPUT

// Note: Analogue pins are

// automatically set as inputs

}

void loop() {

val = analogRead(0); // read the value from

analogWrite(LED, val/4); // turn the LED on at

// the sensor

// the brightness set

// by the sensor

delay(10); // stop the program for

}

// some time





ANY HELP APPRECIATED
9  Using Arduino / General Electronics / Re: ~RECOMMEND A BUCK 12V-5V DC converter? on: September 23, 2012, 04:34:06 pm
Im sure glad you did not keep your keyboard quiet Doc. Prairie Mystic thanks for your input too.

The LEDs Im running are the flexible LED strips which have a max. voltage around 5 volts. So I cant put more "in series".

I can figure out how many amps Im going to be pulling and hope to post again soon.
10  Using Arduino / General Electronics / ~RECOMMEND A BUCK 12V-5V DC converter? on: September 22, 2012, 01:23:56 pm
Im looking for a high amp converter to take a solar battery at 12V down to 5V for large LED arrays? any recommendations ? I hope to have at least 10 amps.
11  Using Arduino / LEDs and Multiplexing / Re: a perplexing LED situation on: April 25, 2012, 09:20:36 am
thanks again...
12  Using Arduino / LEDs and Multiplexing / Re: a perplexing LED situation on: April 24, 2012, 11:13:31 am
aaargh. so after double checking, the source voltage is 9.42. I added all my extra one ohms and brought resistance up to 41 ohms and still getting 54 mA.....
13  Using Arduino / LEDs and Multiplexing / a perplexing LED situation on: April 24, 2012, 11:05:17 am
My values:   source V = 9   ,   LED forward voltage = 4 (white),     LED amps = 30 mA,    2 LEDs

I understand ohms law and using that I would need a 33 ohm resistor.
When I input the specs. into the LED array wizard, I get this:
Solution 0: 2 x 1 array uses 2 LEDs exactly

   
               R = 39 ohms
The wizard says: In solution 0:
each 39 ohm resistor dissipates 35.1 mW
the wizard thinks 1/4W resistors are fine for your application
together, all resistors dissipate 35.1 mW
together, the diodes dissipate 240 mW
total power dissipated by the array is 275.1 mW
the array draws current of 30 mA from the source.


SO.......when I run the circuit my meter reads .054 amps in the circuit.  I am using a 39 ohm resistor. Why is the amperage so much higher? I checked the source and it is a stable 9V. its weird....any thoughts?

THANKS
14  Using Arduino / LEDs and Multiplexing / real time LED control on: April 20, 2012, 09:35:24 pm
besides Pots is there any computer program that can interact with ARduino and allow me to control LED brightness with a slider or key stroke?
15  Using Arduino / LEDs and Multiplexing / Re: wide angle warm white LEDs ?? on: April 20, 2012, 08:36:05 pm
nice, thanks, that should work great
Pages: [1] 2