Skip to content

Instantly share code, notes, and snippets.

@MargenauMaker
Last active October 15, 2019 05:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MargenauMaker/de75f98e1a58b79fc24c9035010f25dc to your computer and use it in GitHub Desktop.
Save MargenauMaker/de75f98e1a58b79fc24c9035010f25dc to your computer and use it in GitHub Desktop.
/* Baisc for loop for students to practice with
* Optimized for Lilymini
* written by B. Elliot Oct 15, 2019
*/
// Dim an LED using a PWM pin
int PWMpin = 3; // LED in series with 470 ohm resistor on pin 10
void setup() {
// no setup needed
}
void loop() {
for (int i = 0; i <= 255; i++) {
analogWrite(PWMpin, i);
delay(20);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment