Serial port - send and receive data


How do I send commands via serial port to my Fez Domino and capture the data sent?

This in arduino is very easy, but not in FEZ Domino.


From Brazil

You open SerialPort and use Read and Write methods:

You can also use USBC_CDC:

Define easy. It’s both working the same way.
You open a serial port, you send data and you capture the data.

Easy = Easy!

Alexandre, did you look over the SerialPort tutorial? Is there anything specific that troubles you? IMO, SerialPort is about as easy as it comes.

In the Arduino IDE has a utility which send data Serial Monitor name, where can I do this in Visual Studio.

See Serial Monitor below:

Use Debug.Print or check out Console class if I am not mistaken
Run MFDeploy while you board is connected to the PC and you will see output there.


serial port is very easy to use, but I need something where you can enter the data without hard code.

Check ianlee’s post :slight_smile:

I see. You’re looking for more of a debug/test utility than a programming API. Unfortunately, there’s nothing in Visual Studio exactly like what Arduino has but, as Architect suggested, you can accomplish the same thing fairly easily by adding some Debug.Print() statements in your code and viewing the output in the Output window. Also, you can execute code and send commands during debugging using the Immediate window while you are debugging. Once you get a hang of it, you’ll find that debugging in VS is exponentially easier and more productive than in Arduino.

Hi ianlee74,

undoubtedly debugging in Visual Studio is easier, but this utility helps when sending data dynamically to the Arduino , I assumed that the Visual Studio would not have a utility equal to the Arduino.

Thank you for your attention and help.

A happy 2012 to you and your entire family.

You have everything you need.

  1. Use Debug.Print() in your code .

  2. Start MFDeploy Select you device and connect to it from “Target” Menu

  3. You will see your Debug.Print() output

I am printing "11"in my test code below

You don’t need to debug it in Visual Studio to see the output. And it is even easier then on Arduino.

@ Architect, I don’t think he’s confused as much about the output as much as he is about how to send the data request dynamically.

@ Alexandre, using a combination of the solution Architect suggested using MFDeploy to view the output plus a terminal software that Robert had suggested (and removed?) to send the input you should be able to perform the test you’re trying to accomplish.

Happy new year to you also! And welcome to the FEZ community!

Perhaps FezTerm is more like what is needed as an example of what is possible? [url][/url]

Oh yeah! I forgot that this one is on wiki was looking for it on coder. Thanks Brett!