{"product_id":"ky-027-with-led-magic-cup-tilt-module-sensor-arduino-tilt-sensor","title":"Ky-027 with Led Magic Cup Tilt Module Sensor Arduino Tilt Sensor","description":"\u003cp\u003eITEM NAME:Ky-027 with Led Magic Cup Tilt Module Sensor Arduino Tilt Sensor Product     Description Description: Product Description: The principle of dimming is to use two modules to change the principle of brightness as pwm. Mercury switch provides digital signal to trigger PWM through programming, We can see that the light of the two cups is full of the effect of dragging 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 \u0026amp;\u0026amp; brightness!= 255) Brightness++; buttonStateB = digitalRead(ButtonPinB); if (buttonStateB == HIGH \u0026amp;\u0026amp; brightness!= 0) Brightness-; analogWrite(LedPinA, brightness); \/\/ analogWrite(LedPinB, 255-brightness); \/\/ Delay (25);.Find many great new \u0026amp; used options and get the best deals for Ky-027 with Led Magic Cup Tilt Module Sensor Arduino Tilt Sensor at the best online prices at Order2india Shopping! Free shipping for many products!\u003c\/p\u003e","brand":"O2INEW","offers":[{"title":"Default Title","offer_id":1405380362255,"sku":"O2I-0-403205582178","price":1597.0,"currency_code":"INR","in_stock":false}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0929\/2582\/products\/s-l2000__26103_aa581913-ff72-4f4b-b3d8-30d46113b49c.png?v=1679871821","url":"https:\/\/order2india.com\/products\/ky-027-with-led-magic-cup-tilt-module-sensor-arduino-tilt-sensor","provider":"ORDER2INDIA SHOPPING","version":"1.0","type":"link"}