void loop()
{
counter=counter+1;
x = analogRead(PeizoPin);
// if (x>800)
// {
// digitalWrite(Vibrator,LOW);
// delay(4000);
// digitalWrite(Vibrator,HIGH); //for version 2.0
// }
if (counter%12==0) {
//digitalWrite(Vibrator, HIGH);
speaker.processMelody(); // for version 3.0
digitalWrite(led, HIGH);
}
if (x>1000) {
//digitalWrite(Vibrator, LOW);
digitalWrite(led, LOW);
Particle.publish("Action","Medicine taken"); //to keep a track of action performance
}
Particle.publish("val",String(x));
delay(1000);
Click to Expand
Content Rating
Is this a good/useful/informative piece of content to include in the project? Have your say!
You must login before you can post a comment. .