StampPlot Help
cplatt
Posts: 55
I am a total beginner and need a little wisdom. I am trying to change the following PBasic command into something StampPlot could use:
DEBUG DEC (x / 1000), ".", DEC2 (x), CR 'displays raw 1234 as 1.234
in my mind it would be:
DEBUG "!ACHN 0, ", DEC (x/1000) + DEC3(x), CR
Alas, of course it doesn't work. I understand that the command cuts up a number in the form 1.234, displays the 1, then the period, then the 234. I just don't understand why? Is it because the stamp cannot display fractions? Anyhow thank you for looking at this.
DEBUG DEC (x / 1000), ".", DEC2 (x), CR 'displays raw 1234 as 1.234
in my mind it would be:
DEBUG "!ACHN 0, ", DEC (x/1000) + DEC3(x), CR
Alas, of course it doesn't work. I understand that the command cuts up a number in the form 1.234, displays the 1, then the period, then the 234. I just don't understand why? Is it because the stamp cannot display fractions? Anyhow thank you for looking at this.
bsp
4K
Comments
Here's a better trick - let StampPlot do the math for you - send data in brackets to perform processing before being used, such as:
[1234 / 1000] would use the value of 1.234. (you can open the DEBUG window and test - ensure you have a space between numbers and operators. In the StampPlot Debug/Immediate window, enter to test:
!DBUG [1234 / 1000]
and see the value. Send the same structure from the BS2:
DEBUG "!ACHN 0,[", dec x, " / 1000]", CR
Note, math is performed left to right without inner brackets for precedence, so:
[1 + 10 * 3] would equal 33.
-Martin Hebel (StampPlot Pro Developer)
!ACHN channel, value, color
DEBUG "!ACHN 0,[", dec x, " / 1000], (RED)",CR