BETTER HOMES
===================================================================================
===================================================================================


Monday, May 08, 2006
-------------------------------------------------------------------------------------------------------------------------------------------------- ANALOGin put.
JUST TESTING A BASIC THING..


int yelPin = 12; //led in digitalpin 12
int s = 3; //analog sensor in analogpin 3
int f =0; //function set on 0 value (=off)

void setup()
{
pinMode(yelPin, OUTPUT); // sets the pins as output
*)pinMode (s, INPUT); //sets the analog sensor as input
*)as seen in Arduino guide, it doesn't have to
been written at all
}
void loop()
{
f=analogRead (s);

if (f >80 ) {
digitalWrite(yelPin,HIGH); //if the sensor's value is bigger than 80,
the LED is on, otherwise it's turned off

}

else {
digitalWrite (yelPin, LOW);
}

}




  12:04 PM
Comments:
WOW! LOOKING GOOD.
 
sjukt snygga bilder ju. I like kort skärpedjup!
 
Post a Comment



<< Home
transformations
---------------------------------
info:
+++++++ ______________________________________ konstfacks' transformation/s.20.06.05 ______________________________________
---------------------------------
archives
May 2006 / June 2006 /
---------------------------------
powered by:
Blogger
---------------------------------
Web Site Counter
Free Hit Counter