Art Game Codes
Art Game Codes
//
void setup()
{
pinMode(A5, INPUT);
pinMode(A3, OUTPUT);
}
void loop()
{
Serial.println(A5);
if (analogRead(A5) > 200) {
tone(A3, 523, 1000); // play tone 60 (C5 = 523 Hz)
}
delay(10); // Delay a little bit to improve simulation performance
}
___________________________________________________________________
_____________
void setup() {
pinMode(A4, OUTPUT); //pin connected to the buzzer
Serial.begin(9600); //sets serial port for communication
}
void loop() {
// read the value from the sensor:
sensorValue = analogRead(sensorPin);
Serial.println(sensorValue); //prints the values coming from the sensor
on the screen
delay(100);
}