int clap = 6 // Pin 6 is our sound sensor
int relay = 7 // Pin 7 is our relay module
voidsetup()
pinMode (clap, INPUT)
pnmode (relay, OUTPUT)
voidloop()
if ( clap = LOW) {
digitalWrite(relay, LOW) //When there is not clap detected, leave the circut open, thus don't affect the PCs state
delay(500) //Wait half a second (about how long we'd hold the power button for)
}
if (clap = HIGH) {
digitalWrite(relay, HIGH) // WHen a clap is dectected, clsoe the circut untill it is not dectaced anymnore, thereby either turning the PC on or off
delay(500) //Wait half a second
}