Skip to content

Commit

Permalink
Patch from issue jprodgers#33.
Browse files Browse the repository at this point in the history
Fix off by one errors that were sending too large a value to LedSign:Set()
for the grayscale level.
  • Loading branch information
root committed Aug 20, 2013
1 parent c36882d commit c96d9da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/examples/LoLShield_Breathe/LoLShield_Breathe.pde
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void setup() // run once, when the sketch starts
void loop() // run over and over again
{
// inhale
for (int8_t i=0; i <= SHADES; i++) {
for (int8_t i=0; i <= SHADES-1; i++) {
uint8_t sleep = inhale_time_ms / SHADES
+ ( SHADES / 2 - i ) * ( inhale_time_ms / (SHADES * 6) );
LedSign::Clear(i);
Expand All @@ -45,7 +45,7 @@ void loop() // run over and over again
delay( hold_breath_ms );

// exhale
for (int8_t i=SHADES; i >= 0; i--) {
for (int8_t i=SHADES-1; i >= 0; i--) {
uint8_t sleep = exhale_time_ms / SHADES
+ ( SHADES / 2 - i ) * ( inhale_time_ms / (SHADES * 6) );
LedSign::Clear(i);
Expand Down

0 comments on commit c96d9da

Please sign in to comment.