FEZTive - Noob questions

Hi all,
So I finally bought some LED strips from adafruit (I didn’t need the 5 meter reel GHI provides) Digital RGB LED Weatherproof Strip - LPD8806 32 LED : ID 306 : $149.75 : Adafruit Industries, Unique & fun DIY electronics and kits

I read Steven Johnston’s blog which is pretty great, but I’m having some problems
http://stevenjohnston.co.uk/2013/04/11/individually-addressable-multicolour-leds-on-net-gadgeteer/

The plan is to have 4x50cm strips which I assume means I need parts A and B joined together, I have a 5V 3A power source attached to the Part A and I get sort of default lights once the power is plugged in, but I can’t get my Fez to make the lights change colours despite the code deploying without issue.

To the noob questions, is the configuration I attached correct? Does the socket from Part B need to plugin to the Fez board as well?

The sample code is simply:

// Use Debug.Print to show messages in Visual Studio's "Output" window during debugging.
Debug.Print("Program Started");
// Initialize the module to use 80 LEDs, with an SPI clock rate of 4Mhz
feztive.Initialize(160, 4000);
// Set every LED to Black (off)
feztive.SetAll(feztive.Black);
// Set every LED to Red
feztive.SetAll(feztive.Red);
// Set every LED to Red
feztive.SetAll(feztive.Red);
// Set every LED to Green
feztive.SetAll(feztive.Green);
Debug.Print("HERE");

Should also point out I did try changing the gadgeteer cable and I have used my multimeter to check there’s a stable current on both ends of the stip. That should also read “9V 5A”.

I hope this is wrong as anything over 6v and the LED’s will be dead

1 Like

@ origin - Also, you are creating an instance for 160 LED’s while the one meter strip you bought contains only 32 LED’s

Thanks pointing that out, you’re right, they should be dead, somehow not though, I’ll switch to a lower supply.

A good point, I’ll try addressing just two or three first to see what happens (I’ll need to go by a DC power supply of 5V and ~3-4A)

Okay, so I’m now up and running with a 5V power supply (thanks @ Bill!), and I have default lights coming up, four white one green.

I’m connected on socket nine but I still can’t change the lights, as per @ James advice I’m now addressing less bulbs than I have (2 for now)



So, do I need to connect the other end of the light strip to FezTive part B?

Should also say I bought 2 meters, the section I’m using (1.5m) has 48 LED’s, since there are lights on by default, I’ve tried:

           feztive.Initialize(48, 4000);

            // Set every LED to Black (off)
            feztive.SetAll(feztive.Black);

I have a previously unused untested set of LPD8806 LED strips (same as Adafruit or GHI’s FezTive LED strips) so I dug it out to play.

From a wiring perspective, the important thing is that you need to make sure the data and clock INPUTs of the LED strip need to be connected to the IO pin the module uses. The strip ends look “the same” from either direction, but they are directional ! I don’t have a FezTive module to confirm which way the wiring is meant to go, but a simple test for you (with only one LED strip connected and no B module) is to check continuity from the Gadgeteer socket to the two inner pads on one of the connections - the DI and SI end of the LED strip needs to be connected to the pads that are directly connected to the socket. From image 2 on this https://www.ghielectronics.com/catalog/product/409 you can see that this looks to be the end closest to the socket. So the top right LED in that picture is element 0, the next one left of that is element 1… and this feeds all the way along the strip and hits the B part of the module, then jumps over to the next strip down. So the end pieces of PCB are really just “loops” that allow you to split the string into rows.

For my test app I simply have a timer that then toggles 3 colours…
in ProgramStarted:

            feztive.Initialize(160, 2000);
            // Use Debug.Print to show messages in Visual Studio's "Output" window during debugging.
            Debug.Print("Program Started");
            PerSec.Tick += PerSec_Tick;
            PerSec.Start();

The timer:

        void PerSec_Tick(GT.Timer timer)
        {
            PulseDebugLED();
            feztive.SetAll(feztive.Red);
            feztive.SetAll(feztive.Green);
            feztive.SetAll(feztive.Black);

        }

and… it all worked first time round. I am feeding my connection with a 5v external power source, it’s drawing about 1.6A at maximum, and the Cobra2 board is being powered with this 5V from a Gadgeteer socket (I am feeding power in both ends of my power strip, haven’t tried it with only one power input)

1 Like

Also, this code is quite “friendly” too https://www.ghielectronics.com/community/codeshare/entry/463

It’s possibly easier to control the strip with this code since the FezTive module doesn’t expose a way to directly manipulate the colour array (you can read the current value but you can’t adjust then write/set it afterwards) - but if all you want to do is set a strip full of one colour then you really don’t need to bother.

(I now have a reason for putting this out on the balcony as a “decoration” :slight_smile: )

1 Like

Thanks very much for replying Brett :slight_smile:

While my wiring (5v->5v, gnd->gnd etc) was correct I did have the strip plugged soldered into the wrong socket, it’s now in furthest right socket, for anyone else out there see the attached image.

I have a 50cm strip plugged in with a 5V, 1A power supply, which should be more than enough. I’ve made some progress, using your example code I’m able to flash the first two bulbs (and any other tests I do I get the same result). The weird thing is there’s still a default bulb lit up at position 12). It knows how many bulbs are in the strip because if I initialise with more than 16 it throws an out of range error.

You can set an individual bulb by:



Having said that, ddurant work looks excellent and I'll definately be drawing on that. I would use an extender module, but I really need four seperate strips from what I'm doing.

So I tried this as well, and you’re right, it is awesome. But still, only 2 LED’s are changing. I’ve tried multiple strips to rule out there being connection problems between each 2x LED section and tested the voltage at the light strip terminals.

Yes, you really do need the connection where it (now) is :slight_smile: I didn’t really realise how the module was meant to be used but it makes sense now.

Can you explain what you need (why you said you need the 4 strips) ? Ultimately, you are either going to use this in one of two ways - one long strip of LEDs that might be cut and joined to form a different shape but is still one long chain of LEDs, or in multiple strips with multiple SPI connections that can then be addressed independently. How many strips do you have, and how many LEDs on each, and how are they wired at the moment?

One thing that I think you should try is to reduce the SPI speed. You may well need to use the DDurant code for that. I suggest this because I saw at one stage when I was using SPI speed of 4Mhz that I would get the strip to initialise correctly, and run a few colour passes, but then it’d “glitch” and only a small number of LEDs at the start of the strip would change, and the only way to fix that was to remove power to the strip - rebooting the Fez would not make a difference. I’ve settled so far on 2Mhz and it seems reasonably stable, they’ve been running for the past 4+ hours without a glitch.

When I tested the LEDs with a defined string length (in code) less than my 160 LEDs on my string, the LEDs after the “point” were simply random colours.

I will zip up my project and put it on my Skydrive and will post you a link to it. I made a few changes to the DDurant code (the Cylon routine in particular) and this way we know we have something that works - if you reply here in the next 20 mins or so I will probably see it and I’ll set it up for your 1st string length. Make sure you’re on the 4.2.11.1 firmware (the GHI 2013 R3 release)

1 Like

Forgot to mention this - yes I know you can set an individual bulb, but for example you might want to increment all the colour values in your string by an amount - but this means you basically have to have a “shadow” of the array that is used in the FEZTive driver, update those, and then write them in. Each SetLED is a slow function too, where an array based operation can be quick, followed by a repaint - the driver allows that, which is necessary if you’re fiddling with the array under the hoods, but since you can’t get to the array it’s a moot point, you have to go back to a slow process… and for animation of this kind, you often want very tight control of speed :slight_smile:

1 Like

http://sdrv.ms/1jvNQek should get you the project (VS2012, Cobra2 mainboard)

Upon thinking about it, given that the the strips strips connected from A to B will still act like one long strip (this I didn’t know) then you’re right, it doesn’t really matter if they’re physically one strip. It’s part of an LED internet connected lamp, they’ll be a central pole with four outward facing strips for each side of my enclosure.

I should have been more specific :slight_smile: I downloaded ddurant’s code from https://www.ghielectronics.com/community/codeshare/entry/463, converted it to VS2013, changed the number of LED’s, wired up the extender module and hit run, I’ve tried an SPI of 4Mhz, 2Mhz and 1Mhz, same problem, only the first two first two LED’s light up. I changed it to 1Mhz, no dice.

Thanks for the code, I’ve tried your version as well and I get the same result. I think we need to consider the possibility that @ Bill was right and by passing 9V through the strip has damaged it, such a rookie mistake, but hey, could be worse, I could have done that to an entire 5m strip!

That’s very interesting, I hadn’t actually started out thinking about animations, just a really bright coarsely controllable set of lights. So this thing will end up being much more awesome.

So I may have burnt out $70 AUD of of LED’s, but I wouldn’t have learnt this. So…silver lining? I’m going to test this theory tomorrow by connecting the segments that are lighting up together.

$70 AUD. So where the heck are ya? Southern Sydney for me. Good to see another Aussie around here.

The good news is certainly that the segments are easily cascaded, they’re meant to :slight_smile: You may find you have only damaged one controller chip in the chain and by jumping over that one the chain will keep working. If you could, it might be worth powering the strip with 5V and GND connections and use a probe set to move the serial and data connections further along the line to see if they start working.

You mention VS2013… are you sure ? :slight_smile:

Anyway good luck - are you working this week or are you now able to tweak things ? :slight_smile:

I had a senior moment last year and fried 5m with 12v - could have sworn it was a 5v power supply…must be a southern thing…

The first few leds would turn white but the whole 5m was toast in my case…

I thought everyone was using 2013 :whistle:

You don’t count at the moment as a “Southern Gentleman”. Or even a “Southern guy” :smiley:

Esp not with comments like that ! ! ! !

Brisbane; the land of the drop bears. I also definitely meant VS 2012.

I’m going to try jumping over the damaged segments as soon as I can, I’m on holidays but I have those nagging xmas commitments (not a feztive attitude, I know).

This makes me feel like less of a gumby!

Exactly what’s happening with mine, and for the same reason, I think we can call it case closed.

Thanks very much all, especially @ Brett. I’ve learnt a lot about the FezTive module and the light strips. I actually prefer the extender module driver over the stock FezTive. Weirdly I’m now going to get more out of the strips than if I hadn’t broken them.