You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
329 B
Arduino

#define IN3 (A3)
int VAL3;
int MAP3;
int CONST;
void setup() {
Serial.begin(9600);
}
void loop() {
VAL3=analogRead(IN3);
Serial.print(VAL3);
MAP3 = map(VAL3, 70, 500, 10, 1200);
CONST = constrain(MAP3, 1, 1200);
tone(11, CONST);
Serial.print("\t");
Serial.print(MAP3);
Serial.print("\t");
Serial.println(CONST);
//delay(50);
}