Software > Software

Serial communication.

(1/2) > >>

I need to be able to quickly write some code that can write 2 bytes to the COM1 port and then wait to receive 2 bytes back. I dont need any fancy GUI, just the windows console is fine.

Do any of you have any source code you could let me see? Or any recommendations for software?

I have used Hyperterminal so far, but i need to perform maths calculations on the incoming bytes, and so need to write it myself.

My programming knowledge is mainly c++ but basic will also do.


do you need to test the com 1 port?
if so do a loopback test

Nope, i am communicating with a PIC. I am sending it a byte for the speed of the motor it is controlling, and a byte for the direction.

Then, when the PIC gets interrupted, the PIC sends out 2 bytes which are the total number of steps performed.

These are what i need to use in my calculations.

I have the whole thing setup, I just want to embed the communication into my app.


Here you have a nice tutorial about serial port programming in windows enviroment:

And some example class that uses above stuff: (com port).


[0] Message Index

[#] Next page

Go to full version