Skip to content

Instantly share code, notes, and snippets.

#include <Servo.h> //include the library for the servo motor
int MIC = A0; //sound detect component connected to A0 leg
boolean toggle = false; //recording the initial version of the toggle
int micVal; //record the detected volume
Servo servo; //set the Servo motor's name as servo
unsigned long current = 0; //record the current time stamp
unsigned long last = 0; //record the last time stamp