is there a way to use slider to control led brightness using PCA9685
I²C-bus controller ?
here is sample sketch
#include <Adafruit_PWMServoDriver.h>
// called this way, it uses the default address 0x40
Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();
void setup() {
Serial.begin(9600);
Serial.println("16 channel PWM test!");
pwm.begin();
pwm.setPWMFreq(1600); // This is the maximum PWM frequency
}
void loop() {
pwm.setPWM(1, 0, 4096 );//setPWM(channel, on, off)
}
After glancing at the Adafruit page about this device, I would say that you can certainly use a combination of sliders and step widgets to make adjustment to all the variables needed.
Lol, no worries… your code is more complete than mine, you are covering all arguments (channel, transition from low to high and transition from high to low)
The step widget can also be set to act sorta like an encoder. Set Send Step to Yes and it will alternate between a positive and negative number (determined by Step value) as you toggle the back and forth buttons. You can then write some code to translate that back and forth count into your encoder application needs.
The value shown on the step widget is not correct when in Send Step mode… ( @Dmitriy - just a reminder: New Android Release 2.10.0 )… but you can setup a display widget to see the true value with this simple example.
Controlling brightness can be done with a Slider or Step widget, as previously shown. Basicly you simply use Blynk widgets to supply the variable values you require for your controller code… how you write your code is up to you.