Difference between revisions of "Magnetic Switch"

From LinkSprite Playgound
Jump to: navigation, search
(Application Ideas)
Line 31: Line 31:
 
  }
 
  }
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
[[File:Magnetic link.jpg]]
  
 
==How to buy==
 
==How to buy==
 
Here to buy Magnetic Switch on [http://store.linksprite.com/magnetic-switch-module-of-linker-kit-for-pcduino-arduino/ store]
 
Here to buy Magnetic Switch on [http://store.linksprite.com/magnetic-switch-module-of-linker-kit-for-pcduino-arduino/ store]

Revision as of 06:14, 24 April 2014

Introduction

This is a magnetic switch module with Linker kit standard connection.

Magnetic switch.jpg

Schematics

Application Ideas

test <syntaxhighlight lang="c">

const int MagneticPin=9; const int ledPin=13; void setup() {

 pinMode(MagneticPin, INPUT);
 pinMode(ledPin,OUTPUT);

}

void loop() {

 int sensorValue = digitalRead(MagneticPin);
 if(sensorValue==1)
 {
   digitalWrite(ledPin,HIGH);
 }
 else
 {
   digitalWrite(ledPin,LOW);
 }
}

</syntaxhighlight>

Magnetic link.jpg

How to buy

Here to buy Magnetic Switch on store