TM1803 radioshack "Tricolor LED strip"
i purchased "tricolor led strip" @ local radioshack. have been troubleshooting problem days now, , need assistance, due beginning skills arduino. using pololu color tester code:
on arduino uno. problem strip displaying green second 3 leds on strip. have + distributed strip , vin, have - distributed gnd , strip, , have data in pin 12. please can't afford spend day googling away @ computer solution.
code: [select]
#include <pololuledstrip.h>
// create ledstrip object on pin 12.
pololuledstrip<12> ledstrip;
// create buffer holding 60 colors. takes 180 bytes.
#define led_count 60
rgb_color colors[led_count];
void setup()
{
// start serial port, communication pc.
serial.begin(115200);
serial.println("ready receive colors.");
}
void loop()
{
// if digit received, go integer parsing mode
// until 3 calls parseint return interger or time out.
if (serial.available())
{
char c = serial.peek();
if (!(c >= '0' && c <= '9'))
{
serial.read(); // discard non-digit character
}
else
{
// read color computer.
rgb_color color;
color.red = serial.parseint();
color.green = serial.parseint();
color.blue = serial.parseint();
// update colors buffer.
for(byte = 0; < led_count; i++)
{
colors[i] = color;
}
// write led strip.
ledstrip.write(colors, led_count);
serial.print("showing color: ");
serial.print(color.red);
serial.print(",");
serial.print(color.green);
serial.print(",");
serial.println(color.blue);
}
}
}
on arduino uno. problem strip displaying green second 3 leds on strip. have + distributed strip , vin, have - distributed gnd , strip, , have data in pin 12. please can't afford spend day googling away @ computer solution.
Arduino Forum > Using Arduino > LEDs and Multiplexing > TM1803 radioshack "Tricolor LED strip"
arduino
Comments
Post a Comment