Edit: nevermind... too late![]()
Edit: nevermind... too late![]()
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Hi DiGGi,
What has been said to you in the last few replies has been correct. If you want to get real basic here you can read porta like this:
Peek PortA, B0 Read PortA and put results in Variable B0
If Bit0 = 1 then task 1 'Reads PortA pin 0, if 1 then goto task 1
If Bit1 = 1 then task 2 'Reads PortA pin 1, if 1 then goto task 2
If Bit2 = 0 then task 3 'Reads PortA pin 2, if 1 then goto task 3
This is really the basic way I started. You can do the BITWISE operations like Paul was showing you also. Whatever you are comfortable with.
Variable B0 now represents a reading of the pins on PortA. you can now look at each pin individually.
Do you have a copy of the PBC manual? If not goto www.melabs.com and download a copy. There is a 2 page explanation on PEEK and a small explanation of POKE.
BobK
thx
i read that manual allready. And found the Bitx command. But i haven't time to test it yet. I'll tiy it later. And let you know if it works or not.
Dirk
Bob,Originally Posted by BobK
Nice addition - your approach is certainly easier and faster to write. Utilizing the fact that Bit0, Bit1, etc. are predifeined as the bits of B0 is the better approach for straightforward (i.e., normal) operations. Thanks for adding - now Dirk has lots of options. If it were me, I would skip the bitwise stuff and use what Bob has above.
Paul Borgmeier
Salt Lake City, UT
USA
__________________
hi,
my prog i working by using Peek and Bit0, Bit1 ...
Thanks for your help!
Diggi
Bookmarks