Created
August 4, 2015 17:35
This file contains 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
//create a global variable for brightness and | |
//set it to 2 | |
int brightness = 2; | |
void setup() | |
{ | |
//set pin 9 to output, any PWM(~) pin will work | |
//with analogWrite() | |
pinMode(9,OUTPUT); | |
} | |
void loop() | |
{ | |
//analogWrite the value of brightness to pin 9 | |
//change the variable of brightness to any number between | |
//0 and 255 which is the full range of analogWrite() | |
//you will only see a brightness change in values 0-100! | |
analogWrite(9,brightness); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment