-
Pic16f84a Question ?
Hi All .
I Have A Litle Problem Here , And Am Sure I Will Find The Answer Here . The Problem Is :
Am Using Picbasic Pro Compiler .
I Need To Read Portb Value . And Then Send It Serially To Another Pic .
The Problem Is When I Connect My Pic16f84a It Send The Value Continuously Without Stop . And I Dont Need That I Need When I Make Pin 0 High Then Send "1" And When I Make Pin 7 High Send "128"
Etc . .
So What Can I Do For That ?
Thanks .
-
Here's a little pseudo code for you
OldValue var byte
repeat
if oldvalue <> PortB then
oldvalue = PortB
SendInteger PortB
endif
forever
Sendinteger is a function to send the numeric value of PortB as a string.
With the above code, you will send only when there is a change from the previous value.
Good Luck
-
and what about pic basic ?
i neverd used pseudo befor .
thanks
-
Pseudo code shows the logic. You have to implement it in PicBasic or any language you choose.