I showed a suggestion of how to do this in reply #11.
outVal = digitalRead(PUSH_BUTTON_6);
if (dim_val < 100) dim_val++;
{
dimmer.setPower(dim_val);
outVal = map(dim_val, 0, 100, 0, 1023);
Blynk.virtualWrite(V0, outVal);
}
outVal = digitalRead(PUSH_BUTTON_7);
{
if (dim_val < 100) dim_val++;
dimmer.setPower(dim_val);
outVal = map(dim_val, 0, 100, 0, 1023);
Blynk.virtualWrite(V0, outVal);
}
like this
value increase and down only 0-9
What is "PUSH_BUTTON_6"? It's it the up or down button? Can you give it a more descriptive name? After you read the pin state, what line in your code checks to see if the button is pressed or not? Only if it is pressed do you want the dimmer level to change.
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.