#include <wiringPi.h>
#include <stdio.h>

#define LED_PIN  26
#define DELY_MS  10

int main(void)
{
    int duty = 1024;

    wiringPiSetup();
    pinMode(LED_PIN, PWM_OUTPUT);

    while(1)
    {
        //led 灭->亮
        for(duty=1024; duty>=0; duty-=4)
        {
            pwmWrite(LED_PIN, duty);
            delay(DELY_MS);
        }

        //led 亮-灭
        for(duty=0; duty<=1024; duty+=4)
        {
            pwmWrite(LED_PIN, duty);
            delay(DELY_MS);
        }
    }

    return 0;
}