yes I know but I can't figure out how to let it go to high but not back to low.
Stand in front of it and keep dancing.
You can't make the sensor stay HIGH. What you can do is detect when it goes HIGH, rather than whether it IS HIGH or LOW.
int prevState = LOW;
int currState;
bool screaming = false;
void loop()
{
currState = digitalRead(pirPin);
if(currState != prevState)
{
// Something moved (or quit moving)
if(currState == HIGH)
{
// Aha, something moved. Scream until the reset key is pressed
screaming = true;
}
}
prevState = currState;
int resetState = digitalRead(resetPin);
if(resetState == HIGH) // Or LOW, if you wired the switch that way
{
screaming = false;
}
if(screaming)
{
Scream();
}
}