Harry Tuttle wrote:
(Output = !Output), can you explain it's function?
Thanks,
ben
Hiya Ben
I have used '=!' as a bitwise 'not equal to'.
So what it does is toggles the value of Output.
So If Output = 0 then after Output = !Output
Output will change to 1
If Output = 1 then after Output = !Output
Output will change to 0
etc.
So in this case was toggling port A0 every time interrupt was accessed.
I find it an easier method to learn than
Toggle = (Toggle XOR 0b11111111) AND 1
The 1 on the far right is the bit you want to toggle.
So if you want to toggle bit 3 you will need to use
Toggle = (Toggle XOR 0b11111111) AND 4
etc.