Skip to content

Instantly share code, notes, and snippets.

@giljr
Created December 2, 2018 01:42
Show Gist options
  • Save giljr/0b4536c075934294882d6180adb87f76 to your computer and use it in GitHub Desktop.
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
/*
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