The following diagram is how i set it up minus the led pin

This is teh code i have so far
const int sensorPin = 0; // pin that the sensor is attached to
// variables:
int sensorValue = 0; //stores the sensor value
int sensorMin = 1023; // minimum sensor value
int sensorMax = 0; // maximum sensor value
void setup() {
// initialize serial communication:
Serial.begin(9600);
}
void loop()
{
sensorValue = analogRead(sensorPin); // stores the value of the sensore pin in Sensor Value
Serial.print(sensorValue); //Prints out the Value
delay(1000);
}

No comments:
Post a Comment