Hey guys, I'm having trouble doing an exercise for my college project and I would like to ask if you could help me.
I'm supposed to connect a switch to a digital entry with an internal pull-up resistance (e.g. pinMode(DX, INPUT_PULLUP)), and I should create and test a code (with a metod called STATE) which makes me able to read the button's recent state every second, as well as its associated moment of time. Therefore it should print both time and the buttons state on the series monitor (in a csv format).
E.g.: While I don't press the button, the monitor prints ("0; 1sec", "0; 2sec", etc.) being "0" the boolean "false", but when I press the button it prints ("1; 3sec", "1, 4sec", etc.).
I would be very thankful if someone helped me ![]()
Thank you for your time