|Perl: the Markov chain saw|
I2C help (from python)by packetstormer (Monk)
|on Nov 30, 2015 at 15:30 UTC||Need Help??|
packetstormer has asked for the
wisdom of the Perl Monks concerning the following question:
Hello monks, the following is a long-shot!
I have a small raspberry pi relay board that I am trying to use. The manufacturer has provided some sample Python code to open and close the relay. However, as the rest of the project is written in perl I'd like to get it working all in one module
Could anyone take a shot at explaining what the python lines below do and how they might translate to perl?
I can manage to open all ports (at the same time!), using Device::SMBus on the relay board in perl but I can't figure out what "&=" and "|&" means in the source script
And my Perl Code
With the perl code all the relays open (or close). So it's really this line self.DEVICE_REG_DATA &= ~(0x1<<0) that's causing my trouble.
Like I said, I know this is a long shot but I'd appreciate some input