Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function setup() {
- // Initiate the serial communication.
- Serial.begin(9600);
- }
- function loop() {
- // Get the value of the light sensor
- sensorValue = <Read value at A0>;
- // Change the tone frequency according to sensorValue
- tone(pin = 9, frequency = (1000 - sensorValue) + 800, duration = 1 second);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement