User manual

www.sainsmart.com
Copyright © 2013 SainSmart All Rights Reserved
Example code:
int brightness = 0; //define original value of brightness, the value is brightness of LED.
int fadeAmount = 5; //define fadeAmountthe value is the amount of brightness variations
change.
void setup() {
pinMode(9, OUTPUT);// set pin9 is output
}
void loop() {
analogWrite(9, brightness);//write the value of brightness in pin9
brightness = brightness + fadeAmount;//change the value of brightness
if (brightness == 0 || brightness == 255) {
fadeAmount = -fadeAmount ; // roll over the brightness between the highest and
lowest
}
delay(30); //delay 30ms
}