Skip to content

Instantly share code, notes, and snippets.

@vortec
Created June 23, 2014 22:34
Show Gist options
  • Select an option

  • Save vortec/5b43afe88dfe5744266d to your computer and use it in GitHub Desktop.

Select an option

Save vortec/5b43afe88dfe5744266d to your computer and use it in GitHub Desktop.
int sensor = 5;
int led = 3;
void setup() {
Serial.begin(9600);
pinMode(led, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
int sensorValue = analogRead(sensor);
analogWrite(led, sensorValue / 4);
Serial.println(sensorValue / 4);
delay(10);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment