Dereference a pointer?

mistergreen:
The serial print would yield 129. I'm assuming that's an address and not the value of deviceState which should either be 0 or 1.

Looks like it's not. Your code is correct, and nevertheless 129 is pretty low for an address