|
@@ -20,19 +20,25 @@ void Atm_led_TLC::initLED() {
|
|
|
}
|
|
|
|
|
|
void Atm_led_TLC::switchOn() {
|
|
|
- tlc.setPWM(pin, current_level);
|
|
|
+ tlc.setPWM(pin, pwm_max);
|
|
|
}
|
|
|
|
|
|
void Atm_led_TLC::switchOff() {
|
|
|
- tlc.setPWM(pin, mapLevel(toLow));
|
|
|
+ tlc.setPWM(pin, pwm_min);
|
|
|
}
|
|
|
|
|
|
void Atm_led_TLC::setBrightness(int value) {
|
|
|
|
|
|
- tlc.setPWM(pin, mapLevel(value));
|
|
|
+ tlc.setPWM(pin, value);
|
|
|
}
|
|
|
|
|
|
int Atm_led_TLC::mapLevel(int level) {
|
|
|
- current_level = map( level, toLow, toHigh, 0, 65535 );
|
|
|
- return current_level;
|
|
|
+ current_level = map( level, toLow, toHigh, pwm_min, pwm_max );
|
|
|
+ return level;
|
|
|
+}
|
|
|
+
|
|
|
+Atm_led_TLC& Atm_led_TLC::setMinMax(int min, int max) {
|
|
|
+ this->pwm_min = min ;
|
|
|
+ this->pwm_max = max ;
|
|
|
+ return *this;
|
|
|
}
|