Changed static .data strings to PSTR(), removed oom situation
This commit is contained in:
14
rgbled.cpp
14
rgbled.cpp
@ -139,16 +139,16 @@ void RgbLed::patternStep()
|
||||
_pwmA->setDutyA(_counter >> 8);
|
||||
_pwmB->setDutyB(_counter >> 3);
|
||||
}
|
||||
else if(_pattern == 4) //Sunrise
|
||||
else if(_pattern == 4)
|
||||
{
|
||||
( _counter < 8192 ) ? _pwmA->setDutyB(_counter >> 6) : _pwmA->setDutyB( 128 + (_counter >> 11));
|
||||
if( _counter > 8192 ) ( _counter < 16384 ) ? _pwmA->setDutyA((_counter-8192) >> 6) : _pwmA->setDutyA( 128 + (_counter >> 9 ));
|
||||
if( _counter > 16384 ) _pwmB->setDutyB((_counter >> 14)*20);
|
||||
( _counter < 8192 ) ? _pwmA->setDutyB(_counter >> 6) : _pwmA->setDutyB( 128 + (_counter >> 11));
|
||||
if( _counter > 1024 ) ( 8192 < _counter && _counter < 16384 ) ? _pwmA->setDutyA((_counter-8192) >> 6) : _pwmA->setDutyA( 128 + (_counter >> 9 ));
|
||||
if( _counter > 8192 ) _pwmB->setDutyB(_counter >> 9);
|
||||
|
||||
if( _counter < 65535 ) _counter++;
|
||||
//else _pwmB->setDutyB(140);
|
||||
if(_counter<65530) _counter++;
|
||||
else _pwmB->setDutyB(140);
|
||||
|
||||
//_delay_ms(18); //honey dose this make me look slow?
|
||||
_delay_ms(18); //honey dose this make me look slow?
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user