Created
September 9, 2021 05:23
-
-
Save margmarg/fc134b70b6f0708ff9a55eb9b8d8282d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://gist.github.com/margmarg/fc134b70b6f0708ff9a55eb9b8d8282d. checking share link