Go Down

Topic: Arduino/PLC/RGB strips (Read 1 time) previous topic - next topic

CrossRoads

#5
Apr 24, 2012, 07:50 am Last Edit: Apr 24, 2012, 07:52 am by CrossRoads Reason: 1
That  particular strip seems to have an embedded IC in it
drive IC: LPD8806
that receives commands and controls the LEDs.
You will need code to send messages to the chip.

Here's a good starting point:
http://www.ladyada.net/products/digitalrgbledstrip/index.html
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Nick Gammon


I use LED RGB strips as you can see in the link below.


Good idea to post the link. Just a tip ... you get a more detailed answer if you give more details in the question. Now we can see the link we can come up with helpful answers.

As an example:

https://github.com/adafruit/LPD8806

There: Arduino library for LED strips and pixels using LPD8806

Myillusionart

Thx a lot to both of you!

Just to make sure i understand you right. Please have a look at my little "programm think sketch"  for the upcoming code using arduino PLC and the RGB LED strips. The inputPin1-6 get +5V from the PLC.

Code: [Select]


void setup ()
{

// setting up all the pins and functions i use e.g. pinMode

}

void loop ()
{

if (inputPin 1 == high)
{
doThingA;

if (inputPin 1 == low)
{
jumpBack to main loop;
}
}
else if (inputPin 2 == high)
{
doThingB;

if (inputPin 2 == low)
{
jumpBack to main loop;
}

// (...) continuing pin 3,4,5, 6

else
{
doThingG;
}

}




CrossRoads

You don't need these
   if (inputPin 1 == low)
   {
      jumpBack to main loop;
   }
If it fails the High condition, the sketch will just continue & read the next sketch.

Also, you need to read the pin:

if (digitalRead(input1pin) == LOW) { ...}
if (digitalRead(input2pin) == LOW) { ...}
if (digitalRead(input3pin) == LOW) { ...}
if (digitalRead(input4pin) == LOW) { ...}
if (digitalRead(input5pin) == LOW) { ...}
if (digitalRead(input6pin) == LOW) { ...}
use the internal pullups, and have your switch ground the pin to make the condition active.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Myillusionart

Hey,

thanks a lot!

I have another question, is there a possibility to calculate the time out of the used code ?  The change of the RGB strip colors should go as fast as possible.

Go Up