ArduSpot
Imagine, Innovate and Surprise yourself!
Switch
/*
* http://arduspot.blogspot.in/p/switch.html
*/
int sw = 1;
int a;
void setup()
{
pinMode(sw,INPUT);
Serial.begin(9600);
}
void loop()
{
a = digitalRead(sw);
if(a == LOW)
{
Serial.println("ON");
}
else
{
Serial.println("OFF");
}
}
No comments:
Post a Comment
Home
Subscribe to:
Comments (Atom)
No comments:
Post a Comment