Hello All-
I have coded in Pic Basic Pro for many years but am trying to get proficient and use Great Cow Basic for any new projects.
My question is if there any others out there who are or who have moved from PBP to GCB, could you help me with I am trying to accomplish with the following line:
`/lookup PRevision dig 1,[zero,one,two,three,four,five,six,seven,eight,nine],DspDig2/'
'/lookup PVersion dig 0,[zero,one,two,three,four,five,six,seven,eight,nine],DspDig3/'
In the 1st line, I am trying to lookup a value based on digit 1 of the variable PRevision in a table of
zero, one, two, three, to nine. and put the value into variable DspDig2.
The 2nd line much the same but lookup based on digit 0 of the variable PRevision in the same table and put it in variable DspDig3.
ALSO, is there a way to specically read or write to a specific digit of a variable?
Any help would be greatly appreciated.
Last edit: Steve Scott 2024-11-22
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I think I am getting some of this.
This is what I have WITHOUT figuring out how to read or write to a specific digit in a variable.
Does this work:
SubDisplayCodeRev'Need to get the single letters to work here - or just satisfied using HEX valuesDspDig1=0x50|Decimal' "r" (0x50) for Revision of code plus (ORed) the decimal point. ' lookup PRevision dig 1,[zero,one,two,three,four,five,six,seven,eight,nine],DspDig2 ReadTable 7Seg, PRevision dig 1, DspDig2 ' lookup PRevision dig 0,[zero,one,two,three,four,five,six,seven,eight,nine],DspDig3 ReadTable 7Seg, PRevision dig 0, DspDig3 gosub WriteToDisp'return End Sub
Hello All-
I have coded in Pic Basic Pro for many years but am trying to get proficient and use Great Cow Basic for any new projects.
My question is if there any others out there who are or who have moved from PBP to GCB, could you help me with I am trying to accomplish with the following line:
`/lookup PRevision dig 1,[zero,one,two,three,four,five,six,seven,eight,nine],DspDig2/'
'/lookup PVersion dig 0,[zero,one,two,three,four,five,six,seven,eight,nine],DspDig3/'
In the 1st line, I am trying to lookup a value based on digit 1 of the variable PRevision in a table of
zero, one, two, three, to nine. and put the value into variable DspDig2.
The 2nd line much the same but lookup based on digit 0 of the variable PRevision in the same table and put it in variable DspDig3.
ALSO, is there a way to specically read or write to a specific digit of a variable?
Any help would be greatly appreciated.
Last edit: Steve Scott 2024-11-22
I think I am getting some of this.
This is what I have WITHOUT figuring out how to read or write to a specific digit in a variable.
Does this work:
I can always use several variables for the individual digits in the Var:
VarD0, VarD1, VarD2, etc.....
This is for writing to a STLED316S 7-segment 8 digit controller via 3-wire SPI.
STLED316S is similar to the existing 7Segment libraries. Hack the existing libraries as this will give you the answer.