In article ,
ewholz@gmail.com writes:
> Hello Group Members,
>
> I am a new user/programmer for the Raspberry Pi.
> I have found a pwm program in python that dims and brights
> an led. I have also found a program in C that does the
> same thing - when run as sudo.
>
> When I exit the C program, the led stays lit.
> I have a program in python that clears up the bus using GPIO.cleanup()
>
> This works fine, and turns the led off, etc.
>
> I am trying to write/find an equivalent program in C that
> will cleanup the gpio the same way.
>
> Any tips or links will help
On exit, turn GPIO's you used as outputs back into inputs,
and then unexport all the GPIOs you used.
I setup an atexit function to do this in my C programs.
I also have a -c (clear) option which does only this, and
can be used to clean up if the program crashed and didn't
get to run the atexit functions last time.
--
Andrew Gabriel
[email address is not usable -- followup in the newsgroup]
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|