i attempted to measure voltage at a point by opening and closing a mosfet switch with interrupt in arduino uno board. i need to measure the voltage after 100 ms from the instant of opening of the switch and to measure the voltage after 100 ms from the instant of the closing of the switch.
The interrupt exactly interrupt at every 4 seconds to open the switch but the problem is the opening time interval of the switch varies for every cycle. 20ms, 50ms etc.,. i attached the code. please help me to rectify the problem.
aurdinuo program.txt (388 Bytes)