3 * Make the OK LED on the Pi Pulsate...
4 * Copyright (c) 2012 gordon Henderson, but please Share and Enjoy!
6 * Originally posted to the Raspberry Pi forums:
7 * http://www.raspberrypi.org/phpBB3/viewtopic.php?p=162581#p162581
9 * Compile this and store it somewhere, then kick it off at boot time
10 * e.g. by putting it in /etc/rc.local and running it in the
31 if ((fd = open ("/sys/class/leds/led0/trigger", O_RDWR)) < 0)
33 fprintf (stderr, "Unable to change LED trigger: %s\n", strerror (errno)) ;
37 write (fd, "none\n", 5) ;
40 if (wiringPiSetupGpio () < 0)
42 fprintf (stderr, "Unable to setup GPIO: %s\n", strerror (errno)) ;
46 softPwmCreate (OK_LED, 0, 100) ;
50 for (i = 0 ; i <= 100 ; ++i)
52 softPwmWrite (OK_LED, i) ;
57 for (i = 100 ; i >= 0 ; --i)
59 softPwmWrite (OK_LED, i) ;