basically I am moding my TV remote so that I can flick through channels quicker. ignore the project aim the mind messing comes later.
I plan to use a ATTiny 85 because of its size. I have 5 I/O's but there other stuff I want to add so be resourceful
Basically I have 1 point where I can solder too. My idea is to make 1 output pulse high and low when the button is low (when its being pressed) Something like this
If button is low {
output high
delay
output low
delay}
Excuse the code just keeping it super simple.
but How do I do this? because all i see happening is it gets stuck in a loop and just carrys on pulsing for ever...
Am I wrong or what ever?
How would you go about this... There must be a solution.
because all i see happening is it gets stuck in a loop and just carrys on pulsing for ever.
You need to post the actual code (using the # icon) so we can see where you messed up.
However look at the 'while' statement for a better approach to this problem.
You can't use a pin as an input and an output at the same time. You have to have one pin for the input button and another for the output button. Then read the input and pulse the output for as long as the input is pushed.
Ok thats what I have now but it just ignores the button press and is 5v all the time even when i press the button... If i remove the ATtiny it works fine.
Thanks. On my breadboard it works perfectly but on the remote it doesn't. Again it just keeps pulsing.
The schematic is simple the 1 solder point I have available on the PCB. It has 2 wires coming off, one to each pin.
I thought it was an electronics problem rather than programming. If I have 1 pin pulsing low and high and one looking for the low (when the button is pressed) surely no matter what it will just go into a dirty loop?
When connecting two devices there must be a common ground, you can't just connect the signals.
Also you can not have a wire acting as an input and an output at the same time. If you only have one solder point you only have one signal, it can't be a control input and an output.