pwb87
Newbie level 3
Hello everybody. I am a newcomer to the world of pic microcontrollers.
Needless to say, I'm pretty inexperienced with coding, and was wondering if any kind souls could take a stab at this, and I could learn from what you come up with. I am using a PIC16F88, Here's what needs to happen:
Set pin 6 as input 1, set pin 10 as output 1, set pin 11 as output 2
When input 1 goes high, look at a counter, if counter is less than 10, do routine 1. If counter is equal to 10, do routine 2
routine 1:
Turn on output 1
when input 1 goes low, wait 5 seconds, then turn output 1 low
increment counter 1
routine 2:
Turn on output 2 for 2 seconds, then turn off
Turn on output 1
when input 1 goes low, wait 5 seconds, then turn output 1 low
reset counter
That's it. Any help would be greatly appreciated.
Needless to say, I'm pretty inexperienced with coding, and was wondering if any kind souls could take a stab at this, and I could learn from what you come up with. I am using a PIC16F88, Here's what needs to happen:
Set pin 6 as input 1, set pin 10 as output 1, set pin 11 as output 2
When input 1 goes high, look at a counter, if counter is less than 10, do routine 1. If counter is equal to 10, do routine 2
routine 1:
Turn on output 1
when input 1 goes low, wait 5 seconds, then turn output 1 low
increment counter 1
routine 2:
Turn on output 2 for 2 seconds, then turn off
Turn on output 1
when input 1 goes low, wait 5 seconds, then turn output 1 low
reset counter
That's it. Any help would be greatly appreciated.