if bit logicator

nick12ab

Senior Member
For variables? As far as I know, you have to use a BASIC cell in order to access the bits then set a value into another variable which is checked with a Logicator if statement to work out what to do next.

The bits are bit0 to bit7 for varA and bit8 to bit15 for varB.
 

Technical

Technical Support
Staff member
You'll be better off just using one of the inbuilt byte variables and setting it to either 0 or 1 - so using a byte variable as if it was a bit variable.

Or if you mean individual input bits - yes this is already possible via a decision cell.
 

pleiser

Senior Member
You'll be better off just using one of the inbuilt byte variables and setting it to either 0 or 1 - so using a byte variable as if it was a bit variable...
I already used too many of the built in bytes and used a basic cell to set the bits. would I have to read a byte and have if else for every combination(128 combinations!?)
 
Last edited:

nick12ab

Senior Member
Custom commands are created by writing a BASIC cell. You say that you have ran out of variables. Even the latest version of Logicator restricts you on variable use, although it is to a lesser extent than older ones. The hidden ones are used for things such as bintoascii in the LCD command. If you convert a blank program to BASIC the symbol definitions at the top will show which byte variables are assigned to each letter and you'll see that some variable numbers have been skipped so you can use them in a BASIC cell.

If you have unused output pins on the PICAXE then they can also be used as bit variables.

You need to state the following:

  • Which PICAXE you are using
  • What the program is doing
  • What you need to do bitwise if for
Also consider moving over from Logicator to BASIC coding. The spaghetti code Logicator produces makes the language look confusing but it isn't really.
 

Technical

Technical Support
Staff member
I already used too many of the built in bytes and used a basic cell to set the bits. would I have to read a byte and have if else for every combination(128 combinations!?)
Perhaps you should explain what you want to do, there may well be a simpler alternative approach.
 

pleiser

Senior Member
Custom commands are created by writing a BASIC cell. You say that you have ran out of variables. ...



Also consider moving over from Logicator to BASIC coding. The spaghetti code Logicator produces makes the language look confusing but it isn't really.
what I meant was there were not enough variables to use each one as a bit,
I switched to basic and finished the program, after a bit of trial and error it works, for anyone interested I will attach the program for 20x2 microbot
 

Attachments

Last edited:
Top