Created
May 16, 2017 03:40
-
-
Save tdnvl/5c7725fe798749aa278927eaf1f3183d to your computer and use it in GitHub Desktop.
Code for the Phantom YoYo High Sensitivity Moisture Sensor with Low Power library (Arduino)
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
// Low Power library | |
#include "LowPower.h" | |
int moisturePin = A0; | |
void setup() { | |
// initialize serial communication at 9600 bits per second: | |
Serial.begin(9600); | |
} | |
void loop() { | |
// Sleep for 8s | |
LowPower.idle(SLEEP_8S, ADC_OFF, TIMER2_OFF, TIMER1_OFF, TIMER0_OFF, SPI_OFF, USART0_OFF, TWI_OFF); | |
int moisturePin = analogRead(A0); | |
Serial.println(moisturePin); | |
delay(500); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment