Need your help with really strange Spark behavior.
Sorry for the link to G+ but I’m restricted to 4 links since I’m a noob. See the full post with links here: https://plus.google.com/116265788926162401547/posts/5evzg4NfWkT
So I’ve been porting over some of the visualizations for my L3D Cube from Arduino to the Spark and I’ve found a some really strange behavior that I can’t explain. The specific viz takes the twinkle that Mark Kriegsman (FastLED) created and add’s support for the built-in mic to make it reactive to sound. I have it working well. You can see the original code here: http://pastebin.com/a5FKiXU3 and the viz here: https://www.youtube.com/watch?v=KVhQlGqAREU.
Here’s where it gets weird. I was making some seemingly innocent modifications to the code and I got very different behaviors.
1 - If you change line 93 to mic /=4; you get this: https://www.youtube.com/watch?v=ByfmYqot0SY. There are no twinkles and it is mildly reactive to sound and I’ve lost the palette.
2 - If you add a third call to dim8_raw after line 95, you get twinkles and reactive but no palette.
3 - If you take the code from line 92 to line 110 and move it to a separate function, you lose the smooth dimming.
Here’s another case of Spark strangeness. I start with Mark’s standard twinkle and I try to add in a rotating palette. So I’ve simplified the problem to just making a call to millis() in the loop and I get the same kind of jerky behavior as #3 above.
Anyone have any ideas?