Closed chrisalexander closed 10 years ago
Ah, it's because the pfd variable is being referenced in a finally
clause instead of an else
. I'll push a fix soon.
By the way, deinit just disables the interrupts on a PiFace Digital which you can do by running:
pfd = pifacedigitalio.PiFaceDigital()
pfd.disable_interrupts()
pifacedigitalio.deinit()
is just there for backwards compatibility and digital_read()
/digital_write()
.
Awesome, thanks.
It should be fixed now, try downloading the latest version (4.0.2). :-)
I just upgraded common to v4.0.0 and digitalio to v3.0.0. When I call pifacedigitalio.deinit() I now get the following message:
Exception UnboundLocalError: UnboundLocalError("local variable 'pfd' referenced before assignment",) in <bound method AmoebaTwo.del of <amoebatwo.AmoebaTwo object at 0xb69e0830>> ignored
I didn't see this previously and I'm not sure if it's causing any problems, but as its in the del it doesn't make a lot of difference.
I checked I had followed the installation instructions and all appears to be well.
Any thoughts on this? I played around with the code a bit but didn't seem to ever get to a situation with no errors. Not calling deinit is the workaround for now but I would prefer to have this cleaning up correctly.
Thanks =)