Pololu Serial Transmitter Code in C#

Can I get the source code for the Pololu Serial Transmitter Utility In C#.

Actually I can’t find any working tutorial or code file online which works in Visual Studio 2008. And I am quite new to this platform.

Hello.

That program isn’t really in a very presentable state at the moment, but we do have an example that shows how to use a C# program to send serial data. Is this your primary goal?

Sample C# program for communicating with the TReX and TReX Jr

Note that this program has some added complexity due to the way the TReX can echo the bytes you send it depending on whether you’re using RS-232 serial or TTL serial. It is set up to automatically detect and discard the echo if present. If you just want to see how to send serial data, pay attention to the parts that use the SerialPort class to read and write bytes. Please ask if you have any questions.

- Ben

Thanks Ben,

Your post was really helpful.

Could you give me some idea about how do I send hex data to the serial port using these commands?

What do you mean by “send hex data”? Phrased like this, it makes it sound like you are fundamentally misunderstanding something. It doesn’t make sense to say you sent a serial byte in hex or decimal, as those are just different ways of representing the same byte value. What you are sending is the value of the byte, and how you represent it is just an implementation detail, not something that affects the value sent.

Or are you just trying to ask something like how to parse a string representation of a hexidecimal number?

- Ben