Prop to Python troubles
AGCB
Posts: 327
I'm just learning to use Python in some very simple programs. I have gotten Arduino to talk to the Python program, but can't seem to figure how to get Prop to do the same.
I've been trying to use the Full Duplex Serial object. (or FDS Plus, have also tried PST) Maybe I'm wrong on this.
Here is the simple Python program
And here is the Arduino program that works
And here is the prop program that doesn't work
I know it looks like baud rates are different (they are for the Arduino and prop programs) but they are right (matched) when I use them. The com port is also matched for each program.
So my ? is, am I using the FDS right or is there something better or easier? I get no errors but no output from the Python when using the Prop
Thanks
Aaron
I've been trying to use the Full Duplex Serial object. (or FDS Plus, have also tried PST) Maybe I'm wrong on this.
Here is the simple Python program
import serial PropData = serial.Serial('com4',115200) while (True): if (PropData.inWaiting()>0): myData = PropData.readline() print myData
And here is the Arduino program that works
int cnt=0; void setup() { Serial.begin(9600); } void loop() { Serial.print("I am counting to: "); Serial.print(cnt); Serial.println(" Mississippi."); cnt= cnt+1; delay(1000); }
And here is the prop program that doesn't work
CON _clkmode = xtal1 + pll16x '80 MHz system clock _xinfreq = 5_000_000 OBJ fds : "fullduplexserialplus" 'fds : "parallax serial terminal" VAR byte num PUB main fds.start(31,30,0,115200) repeat fds.dec(num) fds.str(string(" one-thousand ")) waitcnt(clkfreq+cnt) num++
I know it looks like baud rates are different (they are for the Arduino and prop programs) but they are right (matched) when I use them. The com port is also matched for each program.
So my ? is, am I using the FDS right or is there something better or easier? I get no errors but no output from the Python when using the Prop
Thanks
Aaron
Comments
Try fds.str(string(" one-thousand ",$0d,$0a))
AAron