let's do a try... sorry if i'm wrong.. i try
Code:Main: peek PORTA,B0 if Bit1=1 then transmit ' iF PORTA.1=1 then transmit GOTO Main
let's do a try... sorry if i'm wrong.. i try
Code:Main: peek PORTA,B0 if Bit1=1 then transmit ' iF PORTA.1=1 then transmit GOTO Main
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
The peek reads porta into B0 (you did not include where you have porta defined (unless PB has it defined.. I doubt it, maybe PBP does, I made an include to drop in my code since BP is not a complete product). B0 is byte 0 in the chip.Originally Posted by mister_e
Now that it is in B0, you need to IF against B0. So you can AND it (as it is a byte not a bit) with %00000010.
i based my example on a PBC code example on the Melabs Website.
adcx.bas ==> http://www.melabs.com/resources/samples/x1/pbc/adcx.bas
Our friend already defined PORTA, TRISA and so on on his First post. Read back everything.
As far as i know B0 is a pre-define variable in PBC
BIT1... comes from the PBC code example ( ... ok ok it was BIT2) and nowhere it was pre-define. By their example it seems to return or set the Bit value of B0 variable.
As i said, i tried. I don't have and i don't use PBC.
Let's see what are the result of someone using PBC.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Hello,
If I recall correctly B0 is a byte variable that can be tested for its individual bits. So Mister E is correct. If you peek at a port and have the byte put into the variable B0, then you test the individual pins of the port by testing the bits. Bit0 would be the same as PortA.0 for example. This should also be able to be done with variable B1. It has been a few years since I worked with PBC.
It is a complete product. It serves a specific purpose. Is it the answer to programming with Basic, NO. But it does fill a need if you use it correctly. In my case it didn't fill my need because of what I was trying to accomplish so I bought the upgrade to PBP.
BobK
BobK, i think our friend mramos is in a kind of PMS or bad mood anyway... http://www.picbasic.co.uk/forum/show...05&postcount=3
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
What are PBC's limitations? I've just bought it and wondered what extra goodies which might be useful to me, might be in PBP?Originally Posted by BobK
Tim
Full comparison can be made from the MeLabs website and downloading and comparing the manuals from the two products, but as a (incomplete) summary...
Handy commands such as LCDOut (and others) that save a lot of hassle.
No restrictions on PIC pins and the ability in being able to alias them sensibly.
No restrictions on assigment of variables (RAM) and the ability to alias them.
Powerful IF THEN ELSE ENDIF structure permitting unrestricted nesting.
Easy and direct access to PICs Registers without convoluted PEEKs and POKES.
Ability to embed Programmer CONFIG directives.
The list goes on...
The paradox is that it is the Professional Programmers who have the knowledge and expertise to make PBC do anything they want, yet it is a product aimed at the bottom-end hobbyist. Whilst it is PBP that has all the easy to use features a novice needs, but it is aimed at the Professional. Time is money and life is short... how much of your life do you want to devote to your programming?
No PMS, I feel IF and ENDIF are part of a good compiler (is one every on I have). And I will make PBC do all I need now that I know its limits.Originally Posted by Melanie
Bookmarks