Skip to content

Instantly share code, notes, and snippets.

@margmarg
Created September 9, 2021 05:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save margmarg/fc134b70b6f0708ff9a55eb9b8d8282d to your computer and use it in GitHub Desktop.
Save margmarg/fc134b70b6f0708ff9a55eb9b8d8282d to your computer and use it in GitHub Desktop.
// Pot input LED output for Interaction Lab course
int ledPin = 3;
int analogInPin = 0;
int val = 0;
void setup() {
// put your setup code here, to run once:
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
val = analogRead(analogInPin); // read the value from a sensor
Serial.println(val);
delay(1);
analogWrite(ledPin, val /4);
}
@margmarg
Copy link
Author

margmarg commented Sep 9, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment