Main Site Documentation

Serial port - send and receive data


#1

Hi,

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.

Thanks,

Alexandre
From Brazil


#2

You open SerialPort and use Read and Write methods:

http://wiki.tinyclr.com/index.php?title=UART_-_PC_Communication

You can also use USBC_CDC:

http://code.tinyclr.com/project/191/telnet-type-class-for-netmf/


#3

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


#4

Easy = Easy!


#5

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


#6

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:


#7

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.


#8

ianlee74,

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


#9

Check ianlee’s post :slight_smile:


#10

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.


#11

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.


#12

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


#13

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


#14

@ 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!


#15

Perhaps FezTerm is more like what is needed as an example of what is possible? http://wiki.tinyclr.com/index.php?title=FezTerm


#16

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