Created
December 2, 2018 01:42
-
-
Save giljr/0b4536c075934294882d6180adb87f76 to your computer and use it in GitHub Desktop.
Arduino UNO — Quick Intro A Workshop in BSB with the Kids :) https://medium.com/kidstronics/arduino-uno-quick-intro-94c7c682740a
This file contains hidden or 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
/* | |
Kids-Serie#10 | |
Project : Arduino Start Up | |
Ino File: _10_SimulateAnalogOutput_03.ino | |
*/ | |
void setup() { // put your setup code here, to run once: | |
pinMode(3, OUTPUT); // LED connected | |
pinMode(7, INPUT); // Pot connected | |
} | |
void loop() { // put your main code here, to run repeatedly: | |
int potValue = analogRead(0); // read analog signal from pot | |
analogWrite(3, potValue); // write right up on LED | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment