I have a stick that I wired to my analog pins on my uno, but I can't seem to get the code to work with it properly. I am using example code from unojoy, but what I am finding is this works except it treats the directions as always pressed because I have it set to high until presssed and this rather does the opposite.
controllerData.dpadUpOn = analogRead(A1) >> 2;
controllerData.dpadDownOn = analogRead(A2) >> 2;
controllerData.dpadLeftOn = analogRead(A3) >> 2;
controllerData.dpadRightOn = analogRead(A4) >> 2;
This code does not work:
controllerData.dpadUpOn = !analogRead(A1) >> 2;
controllerData.dpadDownOn = !analogRead(A2) >> 2;
controllerData.dpadLeftOn = !analogRead(A3) >> 2;
controllerData.dpadRightOn = !analogRead(A4) >> 2;
How do I make it so it reads pressed when low, rather than high?