Re: Atmoduino - Ambilight for the masses

by tmaniac on Fri Apr 27, 2012 1:38 am

just be patient...bumping the thread won't help ;)

when the guys are around they will post.

i'm trying to get in touch with the guys who make the FastSPI library. I believe the problem is in that library.

have you tried running the FastSPI test sketch?
tmaniac
 
Posts: 16
Joined: Mon Apr 02, 2012 3:42 pm

Re: Atmoduino - Ambilight for the masses

by scorpie on Sun Apr 29, 2012 3:46 am

patient - I can't be patient, cuz I have a government (my gf thinks she is) :lol:

I tried the "fastspi_led" and this one is working, but only with arduino-0023, I can't compile with arduino-1.0

It must be something else.
scorpie
 
Posts: 48
Joined: Fri Apr 20, 2012 3:35 pm

Re: Atmoduino - Ambilight for the masses

by tmaniac on Sun Apr 29, 2012 5:31 am

when using the attached library you can compile in arduino 1.

it's the library from source.

can you run the example when you compile in v023?
Becouse nothing happens on my side when i upload the program to the arduino.
Attachments
fastspi_source.zip
(8.83 KiB) Downloaded 118 times
tmaniac
 
Posts: 16
Joined: Mon Apr 02, 2012 3:42 pm

Re: Atmoduino - Ambilight for the masses

by scorpie on Sun Apr 29, 2012 7:14 am

Ei,Ei oweh,

I made a mistake I can compile the the "WS2801" library and its working (rainbow,fading usw), not the fastspi

my fault, sorry
scorpie
 
Posts: 48
Joined: Fri Apr 20, 2012 3:35 pm

Re: Atmoduino - Ambilight for the masses

by RickDB on Wed May 02, 2012 8:27 am

Sorry for the delay, work got in the way :(
Good to hear it's working now!

tmaniac wrote:when using the attached library you can compile in arduino 1.

it's the library from source.

can you run the example when you compile in v023?
Becouse nothing happens on my side when i upload the program to the arduino.


Could you try my modified version of FastSPI:

http://dl.dropbox.com/u/2953810/FastSPI_LED.zip

Also updated the Project Wiki to reflect this requirement:

https://bitbucket.org/RickDB/atmoduino/wiki/Home

Should be working for any version of Arduino now and if anyone is still having problems please let me know and I'll see what i can do.
User avatar
RickDB
 
Posts: 7
Joined: Mon Mar 05, 2012 5:06 pm

Re: Atmoduino - Ambilight for the masses

by scorpie on Wed May 02, 2012 11:15 am

compiling in arduino 1.0 now, but the leds are doing nothing.

put the fastspi in the library folder and changed the sketch to this:

#include <FastSPI_LED.h>

#define NUM_LEDS 49

// Sometimes chipsets wire in a backwards sort of way
struct CRGB { unsigned char b; unsigned char r; unsigned char g; };
//struct CRGB { unsigned char r; unsigned char g; unsigned char b; };
struct CRGB *leds;

#define PIN 4

void setup()
{
FastSPI_LED.setLeds(NUM_LEDS);
//FastSPI_LED.setChipset(CFastSPI_LED::SPI_TM1809);
//FastSPI_LED.setChipset(CFastSPI_LED::SPI_LPD6803);
//FastSPI_LED.setChipset(CFastSPI_LED::SPI_HL1606);
//FastSPI_LED.setChipset(CFastSPI_LED::SPI_595);
FastSPI_LED.setChipset(CFastSPI_LED::SPI_WS2801);

FastSPI_LED.setPin(PIN,11,13);
FastSPI_LED.setDataRate(1);
FastSPI_LED.init();
FastSPI_LED.start();

leds = (struct CRGB*)FastSPI_LED.getRGBData();
}

void loop() {
// one at a time
for(int j = 0; j < 3; j++) {
for(int i = 0 ; i < NUM_LEDS; i++ ) {
memset(leds, 0, NUM_LEDS * 3);
switch(j) {
case 0: leds[i].r = 255; break;
case 1: leds[i].g = 255; break;
case 2: leds[i].b = 255; break;
}
FastSPI_LED.show();
delay(10);
}
}

// growing/receeding bars
for(int j = 0; j < 3; j++) {
memset(leds, 0, NUM_LEDS * 3);
for(int i = 0 ; i < NUM_LEDS; i++ ) {
switch(j) {
case 0: leds[i].r = 255; break;
case 1: leds[i].g = 255; break;
case 2: leds[i].b = 255; break;
}
FastSPI_LED.show();
delay(10);
}
for(int i = NUM_LEDS-1 ; i >= 0; i-- ) {
switch(j) {
case 0: leds[i].r = 0; break;
case 1: leds[i].g = 0; break;
case 2: leds[i].b = 0; break;
}
FastSPI_LED.show();
delay(1);
}
}

// Fade in/fade out
for(int j = 0; j < 3; j++ ) {
memset(leds, 0, NUM_LEDS * 3);
for(int k = 0; k < 256; k++) {
for(int i = 0; i < NUM_LEDS; i++ ) {
switch(j) {
case 0: leds[i].r = k; break;
case 1: leds[i].g = k; break;
case 2: leds[i].b = k; break;
}
}
FastSPI_LED.show();
delay(3);
}
for(int k = 255; k >= 0; k--) {
for(int i = 0; i < NUM_LEDS; i++ ) {
switch(j) {
case 0: leds[i].r = k; break;
case 1: leds[i].g = k; break;
case 2: leds[i].b = k; break;
}
}
FastSPI_LED.show();
delay(3);
}
}
}


I tried your sketch with and without this, but nothing changed
FastSPI_LED.setDataRate(1);

sniff
scorpie
 
Posts: 48
Joined: Fri Apr 20, 2012 3:35 pm

Re: Atmoduino - Ambilight for the masses

by tmaniac on Wed May 02, 2012 3:31 pm

No results :(

i went into the Cpp and H files of the library.
It allmost looks like the ws2801 part is unfinished.

Like i mentioned earlier, when setting the chipset to for example lpd6803 some leds work at random.

However, when using the correct chip (ws2801) the arduino and the leds don't do anything.

It's very frustrating! i tried modifiing your sketch to use the default SPI / adafruit ws2801 library but i'm not very good at it :(

BTW, I'm testing everything with the library provided test-sketches to see if the library functions correctly
tmaniac
 
Posts: 16
Joined: Mon Apr 02, 2012 3:42 pm

Re: Atmoduino - Ambilight for the masses

by tmaniac on Sun May 06, 2012 10:41 am

Ok, just made a break through!
Have it working :) (i'm now officially happy)

i was browsing around the Google code project site and found some1 posting the source for a working ws2801 setup.

i downloaded the files and compiled the sketch using the 023 IDE version.

and to my BIG surprise....everything worked!
so i loaded up the atmoduino sketch and BAM! it workes :)

Attached is the FastSPI library that works for me.
Attachments
FastSPI_LED.rar
Working WS2801 FastSPI library (for Arduino .23)
(11.5 KiB) Downloaded 178 times
tmaniac
 
Posts: 16
Joined: Mon Apr 02, 2012 3:42 pm

Re: Atmoduino - Ambilight for the masses

by scorpie on Sun May 06, 2012 11:54 am

Komm an meine Brust mein Freund!!!!

Yikes, where did you find that - it's alive!!! I search the whole weekend and found a lot fastspi.h's but none worked for me.

Thanks a lot, that's amazing
scorpie

p.s

I'm now officially happy, too.
scorpie
 
Posts: 48
Joined: Fri Apr 20, 2012 3:35 pm

Re: Atmoduino - Ambilight for the masses

by tmaniac on Sun May 06, 2012 1:14 pm

Modified the library so you can compile using IDE 1.0

datarate 2 works the best for me :)
also, the RGB values where scrambled (red was green and green was red) so i changed those in the example code.
Attachments
FastSPI_LED.rar
(11.59 KiB) Downloaded 183 times
tmaniac
 
Posts: 16
Joined: Mon Apr 02, 2012 3:42 pm

Re: Atmoduino - Ambilight for the masses

by scorpie on Sun May 06, 2012 2:10 pm

lol

to late - I have datarate=3 and I had to change the colors, too
scorpie
 
Posts: 48
Joined: Fri Apr 20, 2012 3:35 pm

Re: Atmoduino - Ambilight for the masses

by tmaniac on Fri May 18, 2012 5:05 am

I seem to have a problem with performance.

When i whatch HD content with mediaportal and activate the live change in atmowin;
the video playback slows down and stutters, audio gets out of sync.

What can i do about that?
My CPU usage never reaches the 60%
Memory usage doesn't exceed 3GB
tmaniac
 
Posts: 16
Joined: Mon Apr 02, 2012 3:42 pm

Re: Atmoduino - Ambilight for the masses

by tmaniac on Fri May 18, 2012 10:30 am

Never mind, i figured it out.
My GDI was way to high and you need to restart mepo for the settings to correctly take effect.

my last problem is the channel assignment.

do you have a config file for the zone/channel placement?
when manually configuring i only see 4 zones (left/right/top/bottom) and channels....but i don't know in what order i need to place them.

My Backlight setup is:

Top: 16
Left: 11
Right: 11
Bottom: 12

a total of 50
tmaniac
 
Posts: 16
Joined: Mon Apr 02, 2012 3:42 pm

Re: Atmoduino - Ambilight for the masses

by scorpie on Sat May 19, 2012 2:18 pm

if you tell me where the config is stored?

edit - reason, too tired, too much beer, it was the setup for the sedu board

edit 2 - strange I don't know why but I had german on my old pc, also the names for the channel but it was from 0 to 50. Now setting up the new pc everything is different the channels are only 11111... 22222.... 33333.... 44444.... :shock:

open atmowina.exe
choose atmoduino as device and click on configure device and set your amount of leds (50) as channels there

set 16 for the top zone
11 for the left/right zone
12 for the bottom zone

if you change the device to dummy a window pops up showing the arrangement of the zones.
write it down so that you have the possibility to look at it without switching between dummy and atmoduino.

now set the first channel (first led -normally the beginning of the led strip) under "change channel assignment" to the corresponding source. the first led is named channel 0, the second is named channel 1 and so on. where you start depends on the arrangement of your strip.

Make your changes, give it another name than standard and click on" add mapping" to save it.

if the first led is on the lower left side channel 0 would be source 39, is it the first on the top left side it would be source 0. Is a bit hard to explain.

Maybe this explains it better

Image

my settings for that would be

Image

it starts from the left to the right at the top, so it is top/right/bottom/left


hope this helps a bit
scorpie
scorpie
 
Posts: 48
Joined: Fri Apr 20, 2012 3:35 pm

Re: Atmoduino - Ambilight for the masses

by tmaniac on Sun May 20, 2012 5:50 am

you are my hero man!

i changed my config as you said and everything works like a charm! :)

the funny thing is that Atmowin does not effect my 1080p playback and lightpack makes everything stutter.

i'm very happy that this project works :)

i'll post a youtube video later on :)


thanks again!
tmaniac
 
Posts: 16
Joined: Mon Apr 02, 2012 3:42 pm