CodeWalrus

Development => Calculators => Calc Projects, Programming & Tutorials => Topic started by: Ivoah on July 01, 2015, 04:17:57 AM

Title: DotStar/SPI library
Post by: Ivoah on July 01, 2015, 04:17:57 AM
I'm working on a super simple SPI library for the TI-8[34]\+( C?SE)? calculators. The goal is to be able to control some Adafruit DotStar (https://www.adafruit.com/products/2343) individually addressable LEDs with my calculator. I have the basic SPI part done, and I've managed to bang out a "library" for controlling up to 256 LEDs from the linkport. Here's a picture of it running on my 84+ SE:
(http://i.imgur.com/6kcPZBV.jpg)

The code can be found here: https://github.com/Ivoah/z80DotStar

You might notice the two microcontrollers on the breadboard, don't worry, I didn't cheat ;) The one on the bottom is an Arduino Micro and is only being used for 5V, and the one on the top is an ESP8266 + FT232H breakout (uart/gpio/i2c/spi to USB) that just happen to be occupying the other half of the breadboard. You can see the edge of ESP8266 on the far left of the image. The spi.asm file is easily usable in another project, just #include it at the bottom of you code.
Title: Re: DotStar/SPI library
Post by: Dream of Omnimaga on July 01, 2015, 05:03:56 AM
Do you think you could display parts of the LCD content on a LED grid with this? O.O
Title: Re: DotStar/SPI library
Post by: Ivoah on July 01, 2015, 05:10:35 AM
Quote from: DJ Omnimaga on July 01, 2015, 05:03:56 AM
Do you think you could display parts of the LCD content on a LED grid with this? O.O

Easily, if you had enough you could mirror the entire LCD, but that would require 320*240=76800 LEDs, and at $0.36 a pop, that'd be $27,648, not to mention the crazy power requirements and the fact that my program can only handle 256 LEDs. A feasible application for this would be light painting.
Title: Re: DotStar/SPI library
Post by: Dream of Omnimaga on July 01, 2015, 05:14:19 AM
Wait, don't you mean 96x64, since it's for the 84+? That said, it would still be pretty expensive. >.<
Title: Re: DotStar/SPI library
Post by: novenary on July 01, 2015, 06:46:34 PM
Oh nice. It can only handle one-way communications though but it's still possible to implement a half duplex system for it I guess.
Title: Re: DotStar/SPI library
Post by: Snektron on July 01, 2015, 06:51:54 PM
I was actually hinking of tha a while ago, controlling another LCD with a 84+.
You can probably do it with a few SIPO's :P
Title: Re: DotStar/SPI library
Post by: novenary on July 01, 2015, 07:01:34 PM
Mgos did that with an arduino actually. It was pretty neat.
Title: Re: DotStar/SPI library
Post by: Ivoah on July 01, 2015, 09:20:54 PM
Quote from: DJ Omnimaga on July 01, 2015, 05:14:19 AM
Wait, don't you mean 96x64, since it's for the 84+? That said, it would still be pretty expensive. >.<

Well, it will run on either, just a change of include file and header tokens. The latest version actually has a define for choosing target.
Title: Re: DotStar/SPI library
Post by: alexgt on July 02, 2015, 12:17:24 AM
That is awesome O.O!
Now I remake Nagoji 4x3 on Ti-84+ :P
Title: Re: DotStar/SPI library
Post by: Dream of Omnimaga on July 06, 2015, 03:30:20 AM
Quote from: Ivoah on July 01, 2015, 09:20:54 PM
Quote from: DJ Omnimaga on July 01, 2015, 05:14:19 AM
Wait, don't you mean 96x64, since it's for the 84+? That said, it would still be pretty expensive. >.<

Well, it will run on either, just a change of include file and header tokens. The latest version actually has a define for choosing target.
Aah I see now. Thanks for the clarification :)
Title: Re: DotStar/SPI library
Post by: Ivoah on October 12, 2015, 03:16:26 PM
bump

I made this for the 4th of July and forgot to update the topic here
https://www.youtube.com/watch?v=fnkUFXY8PE4

It's kind of hard to see, but the LEDs are cycling through red, white, and blue.
Title: Re: DotStar/SPI library
Post by: Dream of Omnimaga on October 13, 2015, 06:29:02 AM
I was expecting some fireworks :P, but glad that the calculator is safe. THis is cool, by the way :). Was it hard to control from the calc?
Title: Re: DotStar/SPI library
Post by: Ivoah on October 14, 2015, 01:10:24 AM
Quote from: DJ Omnimaga on October 13, 2015, 06:29:02 AM
I was expecting some fireworks :P, but glad that the calculator is safe. THis is cool, by the way :). Was it hard to control from the calc?

Not really, it's just a static animation right now, but I'm trying to make a GUI using DCS. Here's what I have so far:
(https://sr.ht/LRpK.gif)
Title: Re: DotStar/SPI library
Post by: Dream of Omnimaga on October 14, 2015, 03:00:23 AM
Oh that would be nice for controlling, since some people earlier asked on IRC for an hardware schematic, meaning that they probably are interested in reproducing your hardware mod. :)