Hey!
I’m making a device that projects light depending on how much you move in bed, in order to let you sleep faster. Now, for the prototype (and because I like to work in it) I use Max/msp for the interpretation of data, which sends one value to the arduino with led strip. Based on this single value, you’ll get either more or less lights projected.
Right now I’ve adapted the juggle(); from the demoreel to fit this need. However, it moves the leds in both directions due to the beatsin8. Is there any way to make sure the leds only move in one direction? I’ve found out this is more relaxing to look at in bed (waves going away from you).
void jugglemeter() {
// colored dots moving in both directions, amount is dependent on the received value
fadeToBlackBy( leds, NUM_LEDS, 4);
byte dothue = 0;
for( int i = 0; i < receive1; i++) {
leds[beatsin8(i+1,0,NUM_LEDS)] |= CHSV(dothue, 200, 255);
dothue += 8;
}
}
This is the function as I’ve got it now, with super low FPS (5) to make it nice and slow (I can’t find another way to slow down the pattern, but that’s a different question). The ‘receive1’ int thus varies between 0-20 (can be anything) for the amount of light.
Any direction you guys can give me to make it move into a single direction? Thanks a lot!