I am junior high teacher teaching students how to program using Arduino. I know the basics of programing but the students wanted to program a game which is a little above my skill set. I am using the following sketch (http://www.itopen.it/arduino-pong-with-8x8-led-matrix-and-max7219/) to introduce them to programing games. Thanks to this site I understand most of the code. However I would like to add a line of code that will make a piezo buzzer buzz every time the "ball" hits the pad. I think the code should look something like the code bellow, but I am not sure if it is correct or where I would put it.
#define buz 8 // number of pin buzzer connected to
if (HIT_CENTER || HIT_RIGHT || HIT_LEFT) {
digitalWrite(buz, HIGH);
delay(100);
digiralWrite(buz, LOW);
}
Any help would be appreciated.