Difference between revisions of "Button Module"

From LinkSprite Playgound
Jump to: navigation, search
(Sample)
Line 16: Line 16:
 
   if(sensorValue==1)
 
   if(sensorValue==1)
 
   {
 
   {
     Serial.println("Hign");     
+
     Serial.println("High");     
 
   }
 
   }
 
   else
 
   else
Line 26: Line 26:
  
 
</syntaxhighlight>
 
</syntaxhighlight>
 
  
 
== Schematics ==
 
== Schematics ==

Revision as of 05:34, 8 April 2014

Linker button.jpg


Sample

<syntaxhighlight lang="c">

const int ButtonPin=9; void setup() {

 pinMode(ButtonPin, INPUT);
 Serial.begin(9600);        // init serial to 9600b/s

}

void loop() {

 int sensorValue = digitalRead(ButtonPin);
 if(sensorValue==1)
 {
   Serial.println("High");    
 }
 else
 {
   Serial.println("Low");     
   
 }
}

</syntaxhighlight>

Schematics

How to buy

Here to buy Button Module on store