Skip to content

Instantly share code, notes, and snippets.

@w00fz
Created December 9, 2012 23:42
Show Gist options
  • Save w00fz/4247530 to your computer and use it in GitHub Desktop.
Save w00fz/4247530 to your computer and use it in GitHub Desktop.
Arduino simple program for op-amp feedback.
#define MIC A1
#define LED 3
void setup(){
//for debug
//Serial.begin(9600);
pinMode(MIC, INPUT);
pinMode(LED, OUTPUT);
}
void loop(){
int sensor = analogRead(MIC);
sensor = map(sensor, 0, 1023, 0, 255);
analogWrite(LED, sensor);
//for debug
//Serial.println(sensor);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment