Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update TankAlarm2016EnergyStar.ino #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions TankAlarm2016EnergyStar.ino
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ void setup() {
//power up sensor - GSM shield uses pins 0,1,2,3,7 + 8 for mega, 10 for yun
digitalWrite(5, HIGH); //pin five powers 5V to sensor
pinMode(5, OUTPUT);
delay(6000); //wait for sensor signal to normalize
delay(10000); //wait for sensor signal to normalize
readvalue = analogRead(A1); // read a sensor from analog pin 1
delay(1000); //wait for sensor signal to normalize
digitalWrite(5, LOW); // turn off sensor


Expand Down Expand Up @@ -133,10 +134,15 @@ void sleepyTEXT()
//power up sensor - GSM shield uses pins 0,1,2,3,7 + 8 for mega, 10 for yun
digitalWrite(5, HIGH); //pin five powers 5V to sensor
pinMode(5, OUTPUT);
delay(6000); //wait for sensor signal to normalize
delay(10000); //wait for sensor signal to normalize
readfresh = analogRead(A0); //dummy read to refresh adc after wake up
delay(500);
readfresh = analogRead(A0);
delay(500);
readfresh = analogRead(A0);
delay(2000);
readvalue = analogRead(A1); // read a sensor from analog pin 0
delay(1000);
digitalWrite(5, LOW); // turn off sensor

if (readvalue > trigger) {{ // if the sensor is over height
Expand Down