StampPlot Pro (www.selmaware.com) offers great features for Picaxe X1 console control through the programming cable. Sadly the count instruction appears to interfere with serial transmission as in the example below where everything else is functional when the count instruction is disabled. pin 0 is connected to a QRB114 optosensor and processed as a tachometer. The serrxd instruction reads the value of a slide control with the object of controlling motor power. With the count instruction enabled unwanted data appears to be sent through the serial port, periodically resetting StampPlot Pro. Any ideas for workarounds (surrounding <count> with <disconnect> and <reconnect> doesn't improve matters).
getRPMAndPlot: ' main program
for counter = 1 to 50
sertxd("!BSND(pControl)",CR)
serrxd duty
pause 1000
pwmout 1, 49, duty
gosub readTach
next counter
reconnect
stop
readTach:
count 0, 500, countval
rpm = countval * 60
sertxd(#rpm,cr)
sertxd("!O Update",cr)
return
getRPMAndPlot: ' main program
for counter = 1 to 50
sertxd("!BSND(pControl)",CR)
serrxd duty
pause 1000
pwmout 1, 49, duty
gosub readTach
next counter
reconnect
stop
readTach:
count 0, 500, countval
rpm = countval * 60
sertxd(#rpm,cr)
sertxd("!O Update",cr)
return