Skip to content

Instantly share code, notes, and snippets.

@david-casagrande
Last active February 15, 2017 16:09
Show Gist options
  • Select an option

  • Save david-casagrande/7ef691328a7e0126ec751c86c3e78cfe to your computer and use it in GitHub Desktop.

Select an option

Save david-casagrande/7ef691328a7e0126ec751c86c3e78cfe to your computer and use it in GitHub Desktop.
soil-sensor-sketch
int sensorPin = A0;
int powerPin = 13;
void setup() {
Serial.begin(9600);
pinMode(powerPin, OUTPUT);
}
void loop() {
digitalWrite(powerPin, HIGH);
delay(500);
int sensorValue;
sensorValue = analogRead(sensorPin);
Serial.println(sensorValue);
digitalWrite(powerPin, LOW);
delay(500);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment