Skip to content

Instantly share code, notes, and snippets.

@s-estay
Last active April 9, 2017 11:29
Show Gist options
  • Save s-estay/bc0833e34df6b754770e73b5220bbe60 to your computer and use it in GitHub Desktop.
Save s-estay/bc0833e34df6b754770e73b5220bbe60 to your computer and use it in GitHub Desktop.
arduino basics: sink current
// sink current through a LED to digital pin 7
// connection: VCC - LED's anode .. LED's cathode - 1k resistor - pin7 set to low
// VCC is 5V
// 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, LOW);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment