So is there any way to get an Adafruit Gemma (ATTiny85-based) to work with

So is there any way to get an Adafruit Gemma (ATTiny85-based) to work with FastSPI? I saw something about support being “worked on” - is there anything I can do? Lib8tion keeps complaining about no implementation for scale16. I really don’t want to have to rewrite to use the NeoPixel library, it’s not as flexible. I love my HSV!

Mark was working on that, I don’t have a Gemma yet. The problem is the ATTiny85 doesn’t have any hardware multiplication instructions. Getting code onto the Gemma has been annoying from what I hear, though. Or maybe it was the trinket. Either way, ATTiny, no mul instruction. (FastSPI_LED on the gemma/trinket, therefore, will not have inline brightness control)

No support for the ATtiny chips yet, no.
I spent some time with a Gemma and a Trinket (and a Digispark). So I have a handle on the issues; it’s not just a matter of implementing one function because the ATtiny doesn’t have hardware MULtiply, so some timing has to be reworked.

Also, we have to map the pins, but that’s the smaller issue.

It’s still in the queue for future work, and not in the 2.0 library.

Also an idea is that maybe we’ll want to write up a how-to for people who want to use our higher lever functions with the Adafruit driver library for platforms we don’t yet support.

Here’s a simple (HSV) that I’ve been using with adafruit and the trinket. I also would LOVE to have FastSPI on the trinket because I’ve been using it a bit, but will probably go back to Teensy because it’s hard to keep my memory and code size down enough even for basic wearable stuff.

-Zeke

void setHSV(int led, unsigned int hue, byte sat, byte val)
{
unsigned char r,g,b;
unsigned int H_accent = hue/60;
unsigned int bottom = ((255 - sat) * val)>>8;
unsigned int top = val;
unsigned char rising = ((top-bottom) *(hue%60 ) ) / 60 + bottom;
unsigned char falling = ((top-bottom) *(60-hue%60) ) / 60 + bottom;

    switch(H_accent) {
    case 0:
            r = top;
            g = rising;
            b = bottom;
            break;

    case 1:
            r = falling;
            g = top;
            b = bottom;
            break;

    case 2:
            r = bottom;
            g = top;
            b = rising;
            break;

    case 3:
            r = bottom;
            g = falling;
            b = top;
            break;

    case 4:
            r = rising;
            g = bottom;
            b = top;
            break;

    case 5:
            r = top;
            g = bottom;
            b = falling;
            break;
    }
    strip.setPixelColor(led, r, g, b);

}

Wow, that certainly helps. With that, I should be able to get most of my code working - just missing the fill_rainbow, but I can work around that.

This is what I’m making, BTW:

That was run with a long wire, so I wanted it standalone. :smiley:

void rainbowLoop() { //-m3-LOOP HSV RAINBOW
static int hue = 0;
static byte currentFrame = 0;
currentFrame++;
//print(currentFrame);println();

for (int pixel = 0;pixel < ledCount;pixel++)
{
hue += 360/ledCount;
if (hue ]]> 360)
hue = 0;
setHSV(pixel, hue, 255, 255);
}
strip.show();
delay(15);
hue++;
if(currentFrame == 255)
{
currentMode = modeSunset;
}
}

void setAllColor(byte r, byte g, byte b)
{
for (int i = 0; i< ledCount;i++)
{
strip.setPixelColor(i, r, g, b);
}
}

void setAllHSV(unsigned int h, byte s, byte v)
{
for (int i = 0; i< ledCount;i++)
{
setHSV(i, h, s, v);
}
}

That’s a “spectrum” conversion vs. a “rainbow” conversion function, BTW. It’ll work, but it’s larger and slower than the AVR assembly ones we have in the library. We just need to get you a build on ATtiny, even if you don’t use the LED driver functions.

That glove is great!

I’d LOVE to get that. Happy to bring or send you trinkets and such if you need them.

Thank you! I have a Trinket and a Gemma (and a Digispark) to work with; it’s just a matter of making the time to do this and dealing with the “2.0” release process too. But seriously: thank you.

well, thanks for the code, Zeke. Unfortunately, it’s a moot point - I can’t get my Gemmas to work at ALL. I’m really quite annoyed with this now. Apparently I’m going to have to desolder everything, and update the bootloader. damn thing keeps reconnecting.

I had terrible trouble getting my Gemma to work. I eventually had a little more success, and posted both bits here:
http://www.adafruit.com/forums/viewtopic.php?f=25&t=44466&start=30#p225261

The Gemmas only come in 8MHz.
The Trinkets come both 8MHz and 16Mhz.
The Floras is basically a Leonardo (16MHz ATmega 324U, IIRC).

Yea, I did all that. Incredibly frustrated at this point. Damn thing keeps disconnecting and reconnecting.

Gah.
You already changed to this?
chip_erase_delay = 400000;
That was what helped for me.

Other than that, I’m mostly just annoyed at (1) the very rough setup process, and (2) having to push the %^# button all the time.

Yep. I’m probably just going to bitch at the support team, and get a refund or something. I figure a couple of Pro Minis will be almost as small, and I can use my regular code with them. More expensive, though. :frowning:

In general, I’m getting really annoyed with their docs - or lack thereof. Why do I have to scour 5 tutorials to find out a hidden command in one of your libraries? Why do they not have a wiki? The FastSPI docs aren’t great - but they exist, and seem to document everything, in one place.

FWIW, for small boards I like the Teensy3 (ARM Cortex M4, about $20), and the Arduino Nano (AVR ATmega 328, about $15, or cheaper, especially in quality: http://dx.com/p/nano-v3-0-avr-atmega328-p-20au-module-board-usb-cable-for-arduino-118037 )

I can get the OSEPP Pro Mini, locally, for about $20. So not TOO bad.

I just had a silly thought - I think I have a VM for winXP set up, I can probably get that running, and see if it’ll work there. I doubt it, and it won’t happen in time for the party tonight. :confused:

I ended up blowing halloween based on similar issues. We had adorable paper mache cloud costumes for the kids and an umbrella with raindrops for my wife. They were all controlled by a remote with animations for sunrise, sunset and lightning storm. That’s what this code came from.

Sadly I ran into too many problems with the trinkets to make it work and we had to do them without the lights. I’ve had way better luck with the teensy 3’s, but figured this was a good excuse to play on the trinket… I was pretty torn up about it for a while, but I guess it’s a good learning experience. if I can get them running this weekend I’ll post some video.

btw finally got a chance to check out your glove. It’s over the top awesome!

The Pro Mini is an ATmega168, right? I’ve never used that one. I have used a Pro Micro, which is ATmega “32U4”. Blew one right up, actually, if I recall correctly.