I just tried INPUT_PULLUP on A0 and I get exactly the same problem so it's not that. but thanks anyway