dhiltonp / hexbright

The easiest way to start programming your hexbright.
BSD 2-Clause "Simplified" License
124 stars 114 forks source link

Modification to the storbe in Tactical program #35

Open DiHydro opened 11 years ago

DiHydro commented 11 years ago

If the strobe had a bit of jitter, around +- 4 milliseconds, it would be even more disorienting. I had tried to implement this with random(-2,5) but it didn't seem to work quite as well as I hoped.

dhiltonp commented 11 years ago

The library updates 120 times per second. When you call update, it spins until any extra time is consumed. In the update it reads from all of the sensors, and sets the light to be the brightness requested.

The library could be modified to immediately turn on the light by running adjust_light() at the end of set_light(), but I don't want to make that change without thinking more about it. I have a few other things that are higher priority, but feel free to make the change on your copy and submit a merge request after making sure it plays nicely with the existing programs.

dhiltonp commented 11 years ago

So, there should be 2 changes necessary:

Add adjust_light() to line 320 in libraries/hexbright/hexbright.cpp Add delayMicroseconds(random(3500)) right before the set_light (line 72) in programs/tactical/tactical.ino.

This should work, but I don't have a good tool to test jitter right now. It would be great if you would apply those two changes and verify that it works.