Adalight with RGB LEDs?

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
ematson5897
 
Posts: 3
Joined: Thu Jan 05, 2012 3:58 pm

Adalight with RGB LEDs?

Post by ematson5897 »

I am wanting to make an ambilight clone with my Teensy++. I have seen some that use software on the computer other than Processing but there didn't seem to be any that worked well with more than 4 channels. I came across your adalight and wondered if I could build it. But I dont have enough money to buy the strings of lights just for this project (I'm only 14 and stuck without a steady income). I was wondering if there was a way to use this setup with RGB LED's either connected directly and using SoftPWM or with shift registers and this library http://www.elcojacobs.com/shiftpwm/ . I would prefer using shift registers since I already have a setup with 56 RGB LEDs hooked up to 21 registers. I tried looking through both the Arduino code and the Processing code but this level of programming is way over my head (I am new to Processing and I consider myself decently fluent in Arduino). All I really need to know is how to take what Processing sends and convert it to red, green, and blue PWM values (0-255). I can handle setting the pins or shift registers myself. And if anyone knows of some really good tutorials on using processing with Arduino that would really help too!

Thanks for the help,
ematson5897

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: Adalight with RGB LEDs?

Post by pburgess »

Hey there,

I just refreshed some of the code used by Adalight, and this might simplify (slightly) the task of getting this working with discrete LEDs and/or shift registers. Nothing on the Processing side would need to be changed...you could run the normal version of Adalight, only the Arduino sketch would need to change.

Specifically, look for the LEDstream_LPD8806 Ardino sketch in the Adalight repository. This won't do what you need on its own, but might make for a decent starting point. Around lines 174-193, you'll see it's reading data from the serial port and forwarding that data to the LED strip on the SPI bus. I'm not familiar with the shiftpwm library specifically, but what you can likely do is translate the incoming data from the serial port into a format suited to that library.

ematson5897
 
Posts: 3
Joined: Thu Jan 05, 2012 3:58 pm

Re: Adalight with RGB LEDs?

Post by ematson5897 »

Ok thanks. I got it working without the library by making the processing code just sent the r,g,and b values in a different way (probably inefficient but it works). I am encountering problems on the arduino side and the ShiftPWM library. It is giving me this error:
C:\Users\Elliot\Desktop\arduino-0023\libraries\ShiftPWM/pins_arduino_compile_time.h:277: error: redefinition of 'const uint8_t digital_pin_to_port_PGM_ct []'
C:\Users\Elliot\Desktop\arduino-0023\libraries\ShiftPWM/pins_arduino_compile_time.h:277: error: 'const uint8_t digital_pin_to_port_PGM_ct [46]' previously defined here
C:\Users\Elliot\Desktop\arduino-0023\libraries\ShiftPWM/pins_arduino_compile_time.h:284: error: redefinition of 'const uint8_t digital_pin_to_bit_PGM_ct []'
C:\Users\Elliot\Desktop\arduino-0023\libraries\ShiftPWM/pins_arduino_compile_time.h:284: error: 'const uint8_t digital_pin_to_bit_PGM_ct [46]' previously defined here
My code is attached
Attachments
Shift register code (adalight).zip
code
(8.6 KiB) Downloaded 485 times

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: Adalight with RGB LEDs?

Post by pburgess »

Looks like you're including way too many headers for that library. Should only need to include ShiftPWM.h and SPI.h.

ematson5897
 
Posts: 3
Joined: Thu Jan 05, 2012 3:58 pm

Re: Adalight with RGB LEDs?

Post by ematson5897 »

Well If i just use import library with the sketch it still gives me the errors

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”