User manual

www.sainsmart.com
Copyright © 2013 SainSmart All Rights Reserved
{
unsigned char j;
for(j=1;j<=6;j++)//every 200ms light up one of led lamps with 1~6 pin in turn
{
digitalWrite(j,HIGH);//light up the led lamps with j pin
delay(200);//delay 200ms
}
for(j=6;j>=1;j--)//every 200ms got out one of led lamps with 6~1 pin in turn
digitalWrite(j,LOW);//go out the led lamps with j pin
delay(200);//delay 200ms
}
}
//led lamp blink example program
void flash(void)
{
unsigned char j,k;
for(k=0;k<=1;k++)//blink twice
{
for(j=1;j<=6;j++)//light up led lamps with 1~6 pin
digitalWrite(j,HIGH);//light up led lamp with j pin
delay(200);//delay 200ms
for(j=1;j<=6;j++)//go out the led lamp with 1~6 pin
digitalWrite(j,LOW);//go out the led lamp with j pin
delay(200);//delay 200ms
}
}
//led lamp run the example 2 program
void style_2(void)
{
unsigned char j,k;
k=1;//set k is 1
for(j=3;j>=1;j--)
{
digitalWrite(j,HIGH);//light up
digitalWrite(j+k,HIGH);//light up
delay(400);//delay 400ms
k +=2;//k plus 2
}
k=5;//set k is 5
for(j=1;j<=3;j++)
{
digitalWrite(j,LOW);//go out
digitalWrite(j+k,LOW);//go out
delay(400);//delay 400ms