Software debouncing in a servo motor using myoware muscle sensor

Read analog input, create a digital high output ("digital reading of HIGH" is not correct terminology) when the analog reading is > 300:

if (analogRead(A0)>300){
digitalWrite(pin2, HIGH);
// or someVariable = 1;
}
else {
digitalWrite (pin2, LOW);
// or someVariable = 0;
}