narmstrong:
if (tiltState = HIGH) {
That's one problem. This will indeed always evaluate "true".
Try replacing it by:
if (tiltState == HIGH) {
One is assignment, the other boolean comparison.
narmstrong:
if (tiltState = HIGH) {
That's one problem. This will indeed always evaluate "true".
Try replacing it by:
if (tiltState == HIGH) {
One is assignment, the other boolean comparison.