This preview shows page 1. Sign up to view the full content.
Unformatted text preview: // read the sensor: int sensorReading = analogRead(A0); // print the sensor reading so you know its range Serial.println(sensorReading); // map the pitch to the range of the analog input. // change the minimum and maximum input numbers below // depending on the range your sensor's giving: int thisPitch = map(sensorReading, 400, 1000, 100, 1000); // play the pitch: tone(8, thisPitch, 10); }...
View Full Document
This note was uploaded on 01/31/2011 for the course CS 302 taught by Professor J.parker during the Spring '08 term at University of Texas at Austin.
- Spring '08