===================================================================================
===================================================================================
--------------------------------------------------------------------------------------------------------------------------------------------------
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);}}
---------------------------------
+++++++
______________________________________
konstfacks' transformation/s.20.06.05
______________________________________
---------------------------------
May 2006 /
June 2006 /
---------------------------------
Blogger
---------------------------------