Adding new tones
Loop in arduino
if( int i = number; i < number; i++) {
pinMode(i, INPUT);
}
Case statement - switch in C language instead of saying if, you can say case
analog on arduino, doesn’t need pinMode, you can also just say the number without saying the A
1024 - max number you can put in 10 bits, same as 256 which is in 8 bits for javascript
No resistor needed for potentiometer
Two speakers have to be the same otherwise they cancel each other
SERVOS
Test the servo first and add from the library (which is where #include <Servo.h> is coming from
always say myServo as the variable, so it connects to your servo
#include <Servo.h>
Servo myServo; //this is a variable for the servo we're using
int servoPosition = 10;
void setup() {
myServo.attach(5);
}
void loop() {
servoPosition ++
if (servoPosition > 170) servoPosition = 10; //slow and shoot back quick
myServo.write(servoPosition);
delay(30);
}
frequency of zero is quiet, minus blows up