Hi All,
I thought there used to be an "invert" command for picaxe, but maybe not?
Anyhoo, i wish to invert the logic of a complete byte/variable before sending that value out to a port.
e.g. If i have a variable with "00" stored in it, then i want it to invert to "FF" before sending this data out of a port.
I can see there are toggle and togglebit commands, but it seems i would repeat the toggle 8 times to invert the entire byte.
I thought there would be an easier way to achieve this, almost like a "toggle BYTE" command of some sort.
Should i even consider doing something more mathematical like ANDing my variable with a fixed value like FF or 00 etc?
Any help will be greatly welcomed and thanks in advance.
Marty
I thought there used to be an "invert" command for picaxe, but maybe not?
Anyhoo, i wish to invert the logic of a complete byte/variable before sending that value out to a port.
e.g. If i have a variable with "00" stored in it, then i want it to invert to "FF" before sending this data out of a port.
I can see there are toggle and togglebit commands, but it seems i would repeat the toggle 8 times to invert the entire byte.
I thought there would be an easier way to achieve this, almost like a "toggle BYTE" command of some sort.
Should i even consider doing something more mathematical like ANDing my variable with a fixed value like FF or 00 etc?
Any help will be greatly welcomed and thanks in advance.
Marty