Use of HEX with a variable and the XOR function
Posted: Wed Aug 17, 2016 9:43 am
I get an error on the following and I don't understand why. Could someone enhance my learning?
I am working on code to exercise a MCP23S17 port expander and I want a way to invert the logic as there is no way to directly address the port by individual bit as you can in Arduino.
Any direction would be useful.
Regards to All.
Code: Select all
OutPin = hex(ThisPin xor 255) 'this should return a hex value of the inverted value
I am working on code to exercise a MCP23S17 port expander and I want a way to invert the logic as there is no way to directly address the port by individual bit as you can in Arduino.
Any direction would be useful.
Regards to All.