• -25%

KY-027 Magic Light Cup érzékelő modul barkács indítókészlethez KY027 5V

KY-027 Magic Light Cup érzékelő modul barkács indítókészlethez KY027 5V

158 Ft 25% megtakarítás
210 Ft
Nincs adó
Product description
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)
brighness --;
analogWrite(LedPinA, brightness); //
analogWrite(LedPinB, 255 - brightness); //
delay(25);
Mennyiség

 

Biztonsági feltételek

 

Szállításii feltételek

 

Visszaküldési feltételek

KY-027 Magic Light Cup érzékelő modul barkács indítókészlethez KY027 5V
KY-027 Magic Light Cup Sensor Module for diy Starter Kit KY027 5V
Product description
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)
brighness --;
analogWrite(LedPinA, brightness); //
analogWrite(LedPinB, 255 - brightness); //
delay(25);
1005003187803154. - pingto
1005003187803154.

Hasonló kategóriák mint 16 :

Reviews

Write your review

KY-027 Magic Light Cup érzékelő modul barkács indítókészlethez KY027 5V

Product description
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)
brighness --;
analogWrite(LedPinA, brightness); //
analogWrite(LedPinB, 255 - brightness); //
delay(25);

Write your review