AXE027 Picaxe USB

OlliHeath

New Member
Hello everyone,

I was just wondering if anyone knows a code in which i can send 'Distance' and 'Angle' data back through the AXE027 USB Cable so that I can use 'Python' to display the data?

Kind Regards,
Olli Heath
 

hippy

Ex-Staff (retired)
Getting the data out from the PICAXE should be pretty easy, something like ...

SerOut pin, baud, ( #distance, ",", #angle, CR, LF )

Then just a case of opening the AXE027 COM port on the PC side, reading the data, and doing whatever you need to do with it.
 

OlliHeath

New Member
Thanks for the quick reply. So far I have this:

Code:
serout 7,N2400,(254,128)
serout 7,N2400,("Distance:",#w1,"   ")
serout 7,N2400,(254,192)
serout 7,N2400,("Angle:",#w2,"   ")
At the moment, this is outputting the data to a serial LCD connected to my board using pin 7. Do I have to change the pin to the one used by the USB cable?

Oh and by the way, w1 and w2 are my variables for the distance and angle.

Thanks,
Olli Heath
 

OlliHeath

New Member
I have found that I need to use the Sertxd command instead of the Serout command to send data back through the cable.

Thanks for your help,
Olli Heath
 

hippy

Ex-Staff (retired)
I have found that I need to use the Sertxd command instead of the Serout command to send data back through the cable.
Sorry about that; I should have said SEROUT or SERTXD.

Some people prefer to use a single download and data transfer connection while others prefer to keep the data connection separate. The latter is handy when using two cables and wanting to debug a program ( using SERTXD ) while also sending data to a receiver ( using SEROUT ).

There are pro's and con's to each choice.
 

OlliHeath

New Member
Thank you for this information.

I am using the SERTXD to send the information outward via the download cable and displaying the data on a computer screen. I am also using the SEROUT command to send the information to a Serial LCD, connected to my board.

Thanks again!
Olli Heath
 
Top