• -43%

Higanykapcsoló modul KY-017 Mercury Sensor diy Starter Kit KY017

Higanykapcsoló modul KY-017 Mercury Sensor diy Starter Kit KY017

97 Ft 43% megtakarítás
171 Ft
Nincs adó
Description
Mercury switch module and digital 13 interface comes with LED to build a simple circuit, the production of tilt lights
With the digital 13 interface comes with the LED, the mercury tilt switch sensor access to digital 3 interface, when the mercury tilt switch sensor has a button signal, LED light, and vice versa.
Routine source code:
int Led = 13; // define the LED interface
int buttonpin = 3; // Define the mercury tilt switch sensor interface
int val; // Define the numeric variable val
void setup ()
{
pinMode (Led, OUTPUT); // define the LED as the output interface
pinMode (buttonpin, INPUT); // Define the mercury tilt switch sensor as the output interface
}
void loop ()
{
val = digitalRead (buttonpin); // Write the value of the numeric interface 3 to val
if (val == HIGH) // The LED flashes when the mercury tilt switch sensor detects a signal
{
digitalWrite (Led, HIGH);
}
else
{
digitalWrite (Led, LOW);
}
}
Mennyiség

 

Biztonsági feltételek

 

Szállításii feltételek

 

Visszaküldési feltételek

Higanykapcsoló modul KY-017 Mercury Sensor diy Starter Kit KY017
Mercury switch module KY-017 Mercury Sensor diy Starter Kit KY017
Description
Mercury switch module and digital 13 interface comes with LED to build a simple circuit, the production of tilt lights
With the digital 13 interface comes with the LED, the mercury tilt switch sensor access to digital 3 interface, when the mercury tilt switch sensor has a button signal, LED light, and vice versa.
Routine source code:
int Led = 13; // define the LED interface
int buttonpin = 3; // Define the mercury tilt switch sensor interface
int val; // Define the numeric variable val
void setup ()
{
pinMode (Led, OUTPUT); // define the LED as the output interface
pinMode (buttonpin, INPUT); // Define the mercury tilt switch sensor as the output interface
}
void loop ()
{
val = digitalRead (buttonpin); // Write the value of the numeric interface 3 to val
if (val == HIGH) // The LED flashes when the mercury tilt switch sensor detects a signal
{
digitalWrite (Led, HIGH);
}
else
{
digitalWrite (Led, LOW);
}
}
1005003193257810. - pingto
1005003193257810.

Hasonló kategóriák mint 16 :

Reviews

Write your review

Higanykapcsoló modul KY-017 Mercury Sensor diy Starter Kit KY017

Description
Mercury switch module and digital 13 interface comes with LED to build a simple circuit, the production of tilt lights
With the digital 13 interface comes with the LED, the mercury tilt switch sensor access to digital 3 interface, when the mercury tilt switch sensor has a button signal, LED light, and vice versa.
Routine source code:
int Led = 13; // define the LED interface
int buttonpin = 3; // Define the mercury tilt switch sensor interface
int val; // Define the numeric variable val
void setup ()
{
pinMode (Led, OUTPUT); // define the LED as the output interface
pinMode (buttonpin, INPUT); // Define the mercury tilt switch sensor as the output interface
}
void loop ()
{
val = digitalRead (buttonpin); // Write the value of the numeric interface 3 to val
if (val == HIGH) // The LED flashes when the mercury tilt switch sensor detects a signal
{
digitalWrite (Led, HIGH);
}
else
{
digitalWrite (Led, LOW);
}
}

Write your review