/* * Atm_led_mcp.cpp * * Created on: 09.12.2017 * Author: ian */ // #ifdef _ADAFRUIT_TLC59711_H #include #include Atm_led_TLC::Atm_led_TLC(Adafruit_TLC59711& _tlc): Atm_led(), // base class ctor would also be called implicitly, but better style to mention this explicitly :) tlc(_tlc) { // nothing to see here } void Atm_led_TLC::initLED() { tlc.setPWM(pin, 0); //Serial.printf("LED init on pin %x\n", pin); } void Atm_led_TLC::switchOn() { tlc.setPWM(pin, pwm_max); } void Atm_led_TLC::switchOff() { tlc.setPWM(pin, pwm_min); } void Atm_led_TLC::setBrightness(int value) { tlc.setPWM(pin, value); } int Atm_led_TLC::mapLevel(int 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; } // #endif