Author Topic: WS2801 Adalight  (Read 5900 times)

nccwarp9

  • Newbie
  • *
  • Posts: 1
WS2801 Adalight
« on: August 19, 2013, 02:34:27 am »
I have scoured all four corners of the web but in process got more and more confused.


I have a working Adalight setup with 25 LEDs with WS2801 and would like to replace the arduino with digispark.
some posts say to remove all SPI references from the file but I believe they are talking about the library for WS2801 which is not used in [size=78%]https://github.com/adafruit/Adalight/blob/master/Arduino/LEDstream/LEDstream.pde[/size]

So, how exactly can digispark run adalight ?? If it can



Bluebie

  • Sr. Member
  • ****
  • Posts: 486
Re: WS2801 Adalight
« Reply #1 on: August 19, 2013, 04:16:21 am »
Digispark cannot create a serial port on the computer it's attached to, and the adalight software requires that, so you can't replace arduino with digispark easily here.

gogol

  • Sr. Member
  • ****
  • Posts: 398
Re: WS2801 Adalight
« Reply #2 on: August 19, 2013, 07:42:05 am »
Maybe a RS232 to I2C bridge may help.
I ordered for some test an SC18IM700, which you can get for less than $2.

http://ics.nxp.com/products/bridges/uart.i2c.master.gpio/

My plan is, to use that in an RS232 debug-cable, which I can just add to any solution, using I2C and having no other free ports left for debugging.

I expect as well a severe reduction of code-size compared to soft-serial, which has a huge overload, when trying to get that on board just for debugging purposes.

Regards

  gogol

Bluebie

  • Sr. Member
  • ****
  • Posts: 486
Re: WS2801 Adalight
« Reply #3 on: August 20, 2013, 09:18:51 pm »
Have you tried using the single direction soft serial included with the digispark core? You're supposed to be able to use Serial.blah like on regular arduino, but it can only write, not read, and it's designed to be very very compact. I've not tried it yet - I usually debug with music using toneOut and a little speaker!

gogol

  • Sr. Member
  • ****
  • Posts: 398
Re: WS2801 Adalight
« Reply #4 on: August 20, 2013, 11:39:08 pm »
I wasn't aware of that. Will give it a try and report.  When I have time, I will create a wiki-page, where we can enter all possible debug-methods.
As in the restricted world of the attinys the debug-method needs to use as much, as the main program is using. 
So if your main application uses soft-serial, thats your debug way, if you have an lcd-shield connected, use that.
In each case additional libraries are worse.

In my example the single-direction serial would also not help, as I have no free pin! LCD does not work, as I have to see all debug messages after doing some experiments at the other end, where I can't watch the LCD all the time.

For some cases I helped myself, writing some debug values in the eeprom and outputting that after my tests, when I could free up some pins.


regards

  gogol


« Last Edit: August 20, 2013, 11:47:34 pm by gogol »

gogol

  • Sr. Member
  • ****
  • Posts: 398
Re: WS2801 Adalight
« Reply #5 on: August 27, 2013, 03:56:22 am »
Hello Bluebie and others,
Have you tried using the single direction soft serial included with the digispark core? You're supposed to be able to use Serial.blah like on regular arduino, but it can only write, not read, and it's designed to be very very compact. I've not tried it yet - I usually debug with music using toneOut and a little speaker!

I have now searched the Digispark IDE for alternatives, but found none.  Where is this magic single direction serial library?

The only one, I found, is the "DigisParkSoftSerial", which makes use of TinyPinChange, and is a really huge.

As this is bidirectional -even with only one wire-, its very useful in those cases, when you have the resources and one pin left.

However already the very simple example program, need 3.5k flash and 120 byte SRAM (more than half the flash and 25% of the SRAM is in most cases not acceptable).

Thanks for pointing me in the right direction ...

regards

  gogol

Bluebie

  • Sr. Member
  • ****
  • Posts: 486
Re: WS2801 Adalight
« Reply #6 on: August 27, 2013, 09:10:27 am »
Look for tutorials on using serial on arduino. It's the same - just don't read. You don't need any libraries for it. The gist is: In setup: Serial.begin(9600); or you can change to a different speed, but I think the little debug one is limited to lower speeds maybe? Then you can Serial.print and Serial.println and such in your program as needed.