I've been tryin' to latch the output of any digital pin of my board. But it won't work. After 20-25 seconds the built in led starts flashing and all outputs become low (may be code is bein rebooted??). After that the outputs become high again, as it demands the code.
I need to latch in HIGH one output to keep active a relay. I've tried also to use plcLib.h and set()&reset() and latch() functions. But it happens the same I described in first. I'm using UNO.
Please supply your code. Unless your code commands the output to change state, it should remain in the set state.
Please put your code in its own window as seen in other posts. This can be done by placing [code] and [/code] around the code. This makes it easier for others to read.
Almost always caused by a lack of supply decoupling. Outputs will normally be latched, something is happening to to reset your processor. This is normally interference from a motor of some description.
However unless you tell us what you are doing we can not be more specific.
Is the other side of the Arduino plugged into the computer via USB, or is it powered some other way?
Delta_G - Has he said it's a led? Unless I missed something, he's talking about the LED on the board, which blinks as optiboot does it's thing, after the arduino has reset (which is the problem he's dealing with)
There is nothing wrong with that code. So your problems are elsewhere in the hardware not your code. Schematics and well focused pictures help a lot in cases like this.
Is the other side of the Arduino plugged into the computer via USB, or is it powered some other way?
Delta_G - Has he said it's a led? Unless I missed something, he's talking about the LED on the board, which blinks as optiboot does it's thing, after the arduino has reset (which is the problem he's dealing with)
DrAzzy. This whole situation seemed to be silly also for me. But sometimes which's obvious is hard to see. I were always testin' the code with the usb connector. I powered my UNO with a 9V source. Output remained latched. Thanks
Is the other side of the Arduino plugged into the computer via USB, or is it powered some other way?
Delta_G - Has he said it's a led? Unless I missed something, he's talking about the LED on the board, which blinks as optiboot does it's thing, after the arduino has reset (which is the problem he's dealing with)
Sometimes which is obvious is hard to see. I was testin' my code via usb connector. I powered my UNO with a 9V source. Output remained latched as it should be. Thanks DrAzzy
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
And/or a picture of your layout.
Thanks Tom......
Dear Tom. No further need of that. I was always testin' the cirtuit via usb. I powered my board with a 9V source and the pin stayed latched. Feel dumb about it. As I was only lighting a led, I assumed there would be no problem with the usb power.