Skip to content

Instantly share code, notes, and snippets.

@s-estay
Last active April 9, 2017 11:28
Show Gist options
  • Save s-estay/b6c11ea6e01b6d0308b70a25d4e11793 to your computer and use it in GitHub Desktop.
Save s-estay/b6c11ea6e01b6d0308b70a25d4e11793 to your computer and use it in GitHub Desktop.
arduino basics: source current
// source current to a LED through digital pin 7
// connection: pin7 set to high - LED's anode .. LED's cathode - 1k resistor - GND
// LED's anode (+) long terminal
// LED's cathode (-) short terminal
// 1k resistor color code: brown black red
// code executed on Arduino Leonardo
void setup(){
pinMode(7, OUTPUT);
}
void loop(){
digitalWrite(7, HIGH);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment