Last active
February 15, 2017 16:09
-
-
Save david-casagrande/7ef691328a7e0126ec751c86c3e78cfe to your computer and use it in GitHub Desktop.
soil-sensor-sketch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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