I have wrote a simple program that tests external interrupts.
tx is connected to the gate of a mosfet and pin2 is the input of a square wave that goes up and down twice on each loop.
Here is the code:
int tx = 12;
volatile int x = 0;
attachInterrupt(0, increment, RISING);
When i dont turn my circuits battery on, the output is:
When it is on it is
Why am i getting such weirdness?
Surely when my external battery off and the external circut recieves no power, the input pin (2) should always be low and the output should be:
when it is on it should be
I am totally confused by this.
Any tips or suggestions would be appreciated.