Magic Light Cup Module (KY-027)
Rated 5.00 out of 5 based on 2 customer ratings
Mercury switches provide a digital signal that triggers the PWM , through the program design, we can then see the light like two cups filled with the effect of shuffling back and forth. dimming principle is to use the principle of two modules brightness changes for pwm. Mercury switches provide a digital signal that triggers the PWM , through the program design, We can see the light like two cups filled with the effect of shuffling back and forth. test code: int LedPinA = 5; int LedPinB = 6; int ButtonPinA = 7; int ButtonPinB = 4; int buttonStateA = 0; int buttonStateB = 0; int brightness = 0; void setup() { pinMode(LedPinA, OUTPUT); pinMode(LedPinB, OUTPUT); pinMode(ButtonPinA, INPUT); pinMode(ButtonPinB, INPUT); } void loop() { buttonStateA = digitalRead(ButtonPinA); if (buttonStateA == HIGH && brightness != 255) { brightness ; } buttonStateB = digitalRead(ButtonPinB); if (buttonStateB == HIGH && brightness != 0) { brightness --; } analogWrite(LedPinA, brightness); // analogWrite(LedPinB, 255 - brightness); // delay(25); }
Need Help? Contact Us Leave Feedback
Categories: , Electronic Components, Emotions & Coping
Contact Us
[email protected]
+31610763377
Leave Feedback
Contact us for any feedback at: https://vendita-prodotti-parrucchieri.it/contact/
Related Products
-

Rated 5.00 out of 5 -

Select options This product has multiple variants. The options may be chosen on the product pageRated 5.00 out of 5 -


-

Rated 5.00 out of 5