Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Code for the Phantom YoYo High Sensitivity Moisture Sensor with Low Power library (Arduino)
// 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