Hi all,
I often finish up using bits of code that's on the forum in some of my programming, but quite often there are bits & pieces in there that I don't understand, or spend a while trying to find out, primarily when it comes to using operands, etc. I have had a few hunts on the Rev-ed site in th epast, etc, but havent't found an easy-to-view list, something similar to the basic commands .pdf's etc. although some are used within these tutorial/reference .pdf's.
What I mean are things like...
'...used for entering remarks to explain coding
;...also used for remarks
%... % means BINARY number, eg:%1101 = 13 in Decimal. You can also use binary numbers to "mask" pins or characters in variables - ie: ignor or utilise certain characters in the variable to (egturn things on & off.
$... $ means HEX number, eg: $2E = 46 in decimal. Often used when communicating in i2c serial links.
#... I don't know where the # comes into play!
/... used as division. eg: b1/b2 is value in variable b1 divided by the value in variable b2
//... I haven't worked out what the two backslash symbols together do, but I know they are for example used in breaking down a number into individual digits, eg: to display on an LCD
|... another one in my 'must track this one down one day list!
&... I'm not sure how the concantenation works in PIC basic. eg: in the tutorial it is used in the LDC example, like 'let pins = b2 & 240' I don't know exactly what the & is doing, but the code works a treat!
so when I come across a few of these together, it really gets me scratching my knoggin!!
eg: pins = byte & %11110000 | rsbit
Right!!! OK, must be time for another strong coffee!
The PIC-Basic commands is fine, and generally quite well dcumented with examples, but can anyone point me to a ready reckoner source for the use of these operands?
Cheers, Bryan
I often finish up using bits of code that's on the forum in some of my programming, but quite often there are bits & pieces in there that I don't understand, or spend a while trying to find out, primarily when it comes to using operands, etc. I have had a few hunts on the Rev-ed site in th epast, etc, but havent't found an easy-to-view list, something similar to the basic commands .pdf's etc. although some are used within these tutorial/reference .pdf's.
What I mean are things like...
'...used for entering remarks to explain coding
;...also used for remarks
%... % means BINARY number, eg:%1101 = 13 in Decimal. You can also use binary numbers to "mask" pins or characters in variables - ie: ignor or utilise certain characters in the variable to (egturn things on & off.
$... $ means HEX number, eg: $2E = 46 in decimal. Often used when communicating in i2c serial links.
#... I don't know where the # comes into play!
/... used as division. eg: b1/b2 is value in variable b1 divided by the value in variable b2
//... I haven't worked out what the two backslash symbols together do, but I know they are for example used in breaking down a number into individual digits, eg: to display on an LCD
|... another one in my 'must track this one down one day list!
&... I'm not sure how the concantenation works in PIC basic. eg: in the tutorial it is used in the LDC example, like 'let pins = b2 & 240' I don't know exactly what the & is doing, but the code works a treat!
so when I come across a few of these together, it really gets me scratching my knoggin!!
eg: pins = byte & %11110000 | rsbit
Right!!! OK, must be time for another strong coffee!
The PIC-Basic commands is fine, and generally quite well dcumented with examples, but can anyone point me to a ready reckoner source for the use of these operands?
Cheers, Bryan