I did it!! Advanced Belt Kit running on Due with WS2801 pixels

by MarkEMarkEMark on Wed Jan 16, 2013 1:15 pm

See my other forum post for background...

I've finally got the Advanced Belt Kit from the LBD8806 examples, not only running on the Arduino Due but also with the superior WS2801 pixels!

https://github.com/MarkEMarkEMark/WS2801MEO

My changes to Adafruit's code is a bit messy - but I was trying all sorts to get it working and lost any methodical-ness.

I've had it up to 240 frames per second - and it's still silky smooth during the fades with 100 bulbs! :D

**It would be great if someone could get the timer working again*** :?
MarkEMarkEMark
 
Posts: 33
Joined: Thu Dec 20, 2012 8:33 am

Re: I did it!! Advanced Belt Kit running on Due with WS2801 pixels

by MarkEMarkEMark on Tue Jan 22, 2013 9:21 am

I'm not feeling the love here! :lol: I gather not many people have Arduino Dues. I can't recommend it enough - it' so fast.

Anyway - I've added some more programs to the Advanced Belt Kit.

I'd really like to be able to get the Sine table / fixSin / fixCos code working for 255 levels, as the flag looks a bit rubbish now. I've fixed the sine wave function by replacing it with the in-built sin function. I don't think it would work very fast on a standard Ardunino, though :(

(see my other post for more info on this issue: viewtopic.php?f=47&t=36249)

I hope pburgess is listening...
MarkEMarkEMark
 
Posts: 33
Joined: Thu Dec 20, 2012 8:33 am

Re: I did it!! Advanced Belt Kit running on Due with WS2801 pixels

by bonnette_l on Tue Jan 22, 2013 5:50 pm

I down loaded your code and tried it on a "Teensy" and a 25 LED WS2801 string.

It looks great.

Thanks for your work

Larry
bonnette_l
 
Posts: 4
Joined: Mon Jan 21, 2013 12:01 pm

Re: I did it!! Advanced Belt Kit running on Due with WS2801 pixels

by MarkEMarkEMark on Wed Jan 23, 2013 3:44 pm

Thank you!

I'm currently working on getting the Due interrupts working. So the code isn't working at the moment. Use the previous version, if you want a working version.
MarkEMarkEMark
 
Posts: 33
Joined: Thu Dec 20, 2012 8:33 am

Re: I did it!! Advanced Belt Kit running on Due with WS2801 pixels

by MarkEMarkEMark on Sun Jan 27, 2013 5:30 am

I've now added a proper Larson scanner with proper fade trails.

Also added another random strobe, but with the fade written for the Larson scanner. Looks much prettier and natural.

Fixed the 127 instead of 255 level problem of the Simplex Noise

Added a frame delay on some programs - this will eventually be on all of them. The reason for this is that a fixed frame rate can be too fast for some programs, so skipping frames is needed.

Still required: a fix to pburgess sin maths, so that it can once again reach the 'blacks' of the troughs - this affects the WavyFlag and SineWave programs. (I've temporarily fixed the SineWave by using a proper sine, but this will be slow for non-Due)

I hope that more of you get Dues and WS2801s and can get your heads around the advanced belt code, as I'd really like to share programs. I've now added 8 new programs to Pburgess original 4. I'd love to know what he thinks!.
MarkEMarkEMark
 
Posts: 33
Joined: Thu Dec 20, 2012 8:33 am

Re: I did it!! Advanced Belt Kit running on Due with WS2801 pixels

by MarkEMarkEMark on Tue Jan 29, 2013 3:23 pm

I've added a new program type, and done a few bug fixes and streamlining

https://github.com/MarkEMarkEMark/WS2801MEO
MarkEMarkEMark
 
Posts: 33
Joined: Thu Dec 20, 2012 8:33 am

Re: I did it!! Advanced Belt Kit running on Due with WS2801 pixels

by MarkEMarkEMark on Sun Feb 17, 2013 1:19 pm

I've finally got interrupts working on the Due (i.e. replaced the unusable Timer1).

What I've learned is that you should not put any 'Delay' commands in any Due interrupt code. I've had to remove the 'Delay(1);' from Adafruit's driver code. I debugged this by chipping away at the driver to get to the basics, and after I worked out that it was the 'Delay', I saw that my chipping away had saved a bit of memory, so I've left it like that. The driver code is now significantly different from the Adafruit original, and is SPI only - the slower user-defined pins will no longer work.

There are also several other improvements and bug fixes.

Now that I've finally got the interrupt issue sorted, the next stage is put some kind of user-interface into it, so that it's no longer just randomly changing programs. I want to be able to select the program I want from my phone, or something like that.
MarkEMarkEMark
 
Posts: 33
Joined: Thu Dec 20, 2012 8:33 am

Re: I did it!! Advanced Belt Kit running on Due with WS2801 pixels

by slurry bowl on Mon Feb 18, 2013 12:39 pm

so am i right that only strandtest works on Uno/Duemilanovea ?

Cant wait to get a Duo !
slurry bowl
 
Posts: 121
Joined: Sun Nov 11, 2012 5:37 pm

Re: I did it!! Advanced Belt Kit running on Due with WS2801 pixels

by MarkEMarkEMark on Thu Feb 21, 2013 12:17 pm

I don't know. I've only every had a Mega and a Due. I can't see why the normal belt wouldn't work on and Uno.

I hope you get your Due soon. Not many people seem to be using them yet.
MarkEMarkEMark
 
Posts: 33
Joined: Thu Dec 20, 2012 8:33 am

Re: I did it!! Advanced Belt Kit running on Due with WS2801 pixels

by MarkEMarkEMark on Sat Feb 23, 2013 12:22 pm

I've added an on/off switch (but it fades up/down to keep in spirit of the original code)

- I've also included examples of just interrupts and also the button code. The button code is based on Adafruit's original debouncing code that used a timer that is no longer used by the Due(http://www.adafruit.com/blog/2009/10/20 ... ebouncing/). I've updated it to use the new interrupts.
MarkEMarkEMark
 
Posts: 33
Joined: Thu Dec 20, 2012 8:33 am