// File: LEDs.c //------------------------------------------------------------------------------ // Author: Giovanni de Sanctis // Email: info@lateral-technologies.com //------------------------------------------------------------------------------ // Date: Dec 2018 // Controls the LED strip //------------------------------------------------------------------------------ #include "LEDs.h" void stopLEDs() { PWM3_Stop(); } void startLEDs() { PWM3_Start(); } void setLEDsBrightness(uint8_t level) { uint16_t value; if (level>95) value=PWM3_MAX_PERIOD_COUNT; else value=(uint16_t)level*PWM3_PERC_FACTOR; PWM3_DutyCycleSet(value); PWM3_LoadBufferSet(); } void setLEDsBrightness2(int16_t level) { if (level>PWM3_MAX_PERIOD_COUNT) level=PWM3_MAX_PERIOD_COUNT; PWM3_DutyCycleSet((uint16_t)level); PWM3_LoadBufferSet(); }