const int sensorPin = 0;
const int sensorPin2 = 1;
const int sensorPin3 = 2;
const int sensorPin4 = 3;
const int speakerpin = 9;
int lightLevel;
int lightLevel2;
int lightLevel3;
int lightLevel4;
void setup() {
//this is our setup code:
pinMode(speakerpin, OUTPUT);
Serial.begin(9600); //WE GONNA HAVE THIS HOOKED TO A SERIAL MONITER!
}
void loop() {
// this is our main code:
lightLevel = analogRead(sensorPin);
lightLevel2 = analogRead(sensorPin2);
lightLevel3 = analogRead(sensorPin3);
lightLevel4 = analogRead(sensorPin4);
Serial.println("Note C: ");
Serial.println(lightLevel); //serial moniter readings.
Serial.println("\n");
Serial.println("Note D: ");
Serial.println(lightLevel2);
Serial.println("\n");
Serial.println("Note E: ");
Serial.println(lightLevel3);
Serial.println("\n");
Serial.println("Note F: ");
Serial.println(lightLevel4);
Serial.println("\n");
if (lightLevel < 880 ) {
tone(speakerpin, 262, 500); // the sounds emitted by the speaker.
} //when the light that the photo resistor detects dips below a certain threshold,the speaker plays.
else if (lightLevel2 < 630) {
tone(speakerpin, 294, 500);
}
else if (lightLevel3 < 880) {
tone(speakerpin, 330,500);
}
else if (lightLevel4 < 850) {
tone(speakerpin, 349,500);
}
else{
noTone(speakerpin);
}
}
//8 steps my dudes remember dat now my home-slice-bread-slice dog
//860 4 da stare lite!
const int sensorPin2 = 1;
const int sensorPin3 = 2;
const int sensorPin4 = 3;
const int speakerpin = 9;
int lightLevel;
int lightLevel2;
int lightLevel3;
int lightLevel4;
void setup() {
//this is our setup code:
pinMode(speakerpin, OUTPUT);
Serial.begin(9600); //WE GONNA HAVE THIS HOOKED TO A SERIAL MONITER!
}
void loop() {
// this is our main code:
lightLevel = analogRead(sensorPin);
lightLevel2 = analogRead(sensorPin2);
lightLevel3 = analogRead(sensorPin3);
lightLevel4 = analogRead(sensorPin4);
Serial.println("Note C: ");
Serial.println(lightLevel); //serial moniter readings.
Serial.println("\n");
Serial.println("Note D: ");
Serial.println(lightLevel2);
Serial.println("\n");
Serial.println("Note E: ");
Serial.println(lightLevel3);
Serial.println("\n");
Serial.println("Note F: ");
Serial.println(lightLevel4);
Serial.println("\n");
if (lightLevel < 880 ) {
tone(speakerpin, 262, 500); // the sounds emitted by the speaker.
} //when the light that the photo resistor detects dips below a certain threshold,the speaker plays.
else if (lightLevel2 < 630) {
tone(speakerpin, 294, 500);
}
else if (lightLevel3 < 880) {
tone(speakerpin, 330,500);
}
else if (lightLevel4 < 850) {
tone(speakerpin, 349,500);
}
else{
noTone(speakerpin);
}
}
//8 steps my dudes remember dat now my home-slice-bread-slice dog
//860 4 da stare lite!