Picaxe and Stampplot Pro

JanJor

Member
Dear all, I recently downloaded the program StampPlot, that provides easy ways of plotting graphs from the Basic Stamp. Works very well! It also works well with the Picaxe, as expected. There is however something I can not solve: if the Stamp sends:
"debug IBIN8 val,CR"
then Stampplot understands this and shows eight blue lines representing either 1 or 0 depending on the 8 bits of Val. Picaxe however has no IBIN-command. If I send for example
Sertxd ("%10101000",CR)
I perfectly get the binary representation of 10101000 as with the Stamp. BUT: how do I send the binary code of a variable from the Picaxe?
Sertxd ("%b1",CR") does not work.
Anyone of you having a brilliant idea about how to solve this?
Thank you in advance, Ronald

 
 

hippy

Ex-Staff (retired)
Untested, but you can try ...

b0 = <i>8-bit value to display </i>
SERTXD(&quot;%&quot;,#bit7,#bit6,#bit5,#bit4,#bit3,#bit2,#bit1,#bit0,CR)

You can use #bit15..#bit8 to send the bit value of b1.

Edited by - hippy on 27/12/2006 00:17:04
 

xstamp

Senior Member
Just knocked this up to try sending analog and digital reading to StampPlot but sure it can be done better....


'DISPLAY TWO ANALOG AND DIGITAL INPUTS
'FROM A 08M, USING STAMPPLOT PRO


setfreq m8

pause 4000

sertxd (&quot;!RSET&quot;,cr)
sertxd (&quot;!TITL slowscope&quot;,cr)
sertxd (&quot;!SAMT 90&quot;,cr)
sertxd (&quot;!TMAX 20&quot;,cr)
sertxd (&quot;!SPAN 0.500&quot;,cr)
sertxd (&quot;!SHFT ON&quot;,cr)
sertxd (&quot;!FLSH ON&quot;,cr)
sertxd (&quot;!PLOT ON&quot;,cr)
sertxd (&quot;!YLBL 5 V&quot;,cr)
sertxd (&quot;!RSET&quot;,cr)

start:
readadc 1,b0
readadc 2,b1

let w1 = b0*2
let w2 = b1*2

let b6= pins &amp; %00011000
let b7 = b6 /8

if b7 = 0 then sertxd (&quot;%00&quot;,cr)
endif
if b7 = 1 then sertxd (&quot;%01&quot;,cr)
endif
if b7 = 2 then sertxd (&quot;%10&quot;,cr)
endif
if b7 = 3 then sertxd (&quot;%11&quot;,cr)
endif

sertxd (#w1,&quot;,&quot;,#w2,cr)
pause 10
goto start










 

JanJor

Member
Hi Hippy, hi XSTAMP, thanks for your help.
XSTAMP's approach works fine, at least for small numbers of digital lines; between 1 and 3 (between 2 and 8 if-then statements are acceptable), so for the moment I can use it.

XSTAMP, thanks for mentioning the new stampplot version in the first place. It's thanks to you that I can use it!
Best regards,
Ronald

 
 

JanJor

Member
Hippy, XSTAMP, the following solves the problem:
SERTXD (&quot;%&quot;,#bit7,&quot;,&quot;,#bit6,&quot;,&quot;,#bit5,&quot;,&quot;,#bit4,&quot;,&quot;,#bit3,&quot;,&quot;,#bit2,&quot;,&quot;,#bit1,&quot;,&quot;,#bit0,&quot;,&quot;,CR)
Thanks again.
Ronald


 
 

xstamp

Senior Member
jandor.....Please to hear you&#8217;re getting on well with StampPlot. I have made an &#8216;interface dongle&#8217; based on an &#8211;08M mounted in a 9-way &#8216;D&#8217; cover. It has short flying leads/clips at one end for analog and digital inputs (could be good for monitoring those PID systems) and a standard 9-way socket at the PC end.

StampPlot allows you to set the RTS line (pin 7 from the serial port) high and I have used this to power the interface dongle via a low drop 5V regulator. All works fine as basic strip chart display, but I still find the maths functions (optional) documentation rather hard going.


 
Top