Re: Truth Tables in PBP
Thanks Guys!
While all are better than what I was playing with, I like the array scheme. I just don't do enough arrays to keep them front and center in my head.
Unfortunately, I didn't have the presence of mind to neatly stack the inputs into a nibble on a port..... using A0, A1, A4, and A5 on a 16F616
I do understand the philosophy, but there is one wrinkle; there are 2 cases in which I need to a pin high, time out for 2 sec and then go low. If the condition on the inputs pins stays the same, the timed pin just stays high.
I even used DT's instant interrupts (so cool) to time the pin but that didn't seem to work.
This should be so easy, but I am missing something and its probably so visible that I can't see it!
What I get when I test my primitive code is the LEDs flash (I use them for debugging) and the timed pin never times out UNTIL the input condition changes. Snippit below:
Code:
if command=1 and dpi=0 and bolt=1 and deadlck=1 then
t1=0 : t2=0 : t3=1 'leds
if tflag=1 then Main1X 'been here before so step around
unlock=0
unsecure=0
lock=1 'Turn ON sol
t1=0 : t2=1 : t3=0
pause 2000 'wait 2 sec
t1=0 : t2=1 : t1=1
lock=0 'Turn OFF sol
tflag=1 'We did it so set flag
t1=1 : t2=0 : t3=0
Main1X: t1=1 : t2=0 : t3=1
unlock=0
unsecure=0
endif
"If we knew what we were doing, it wouldn't be called research"
- Albert Einstein
Bookmarks