Pololu.com serial port program cygwin issues

Anyone get the example ssc_tester to work?

I try

make ssc

and I get

bash-2.05b$ gcc ssc.c 
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../libcygwin.a(libcmain.o)(.text+0xb3): undefined reference to `_WinMain@16'
collect2: ld returned 1 exit status
bash-2.05b$ uname -a
CYGWIN_NT-5.1 T42 1.5.13(0.122/4/2) 2005-03-01 11:01 i686 unknown unknown Cygwin

Any thoughts. Is there a really simple program that I can use to just send a couple of bytes to COM1?



Have you tried our Serial Transmitter utility?

- Ben

Thanks Ben,
There are many GUI programs out there. I’m looking for something I can run from the DOS command line. It would seem simpler than a GUI and yet I can’t find a single one.

Any help would be great.

It’s not too hard to make your own command line program that sends and receives bytes on a serial port.

First, download a version of Microsoft Visual Studio. I recommend Microsoft Visual C# 2008 Express Edition, but if you have experience with Visual Basic or C++ then you might prefer those versions, and those versions will probably work too.


Run Visual Studio. Click “File -> New Project”. Select “Console Application” to make a program you can run from the DOS command line.

Then you can use the System.IO.Ports.SerialPort class to open up a serial port and write bytes to it. Here is a simple (untested) example that opens COM1 at 9600 baud and writes the bytes 0x01, 0x02, and 0x03 to it:

static void Main(string[] args)
    var serialPort = new System.IO.Ports.SerialPort("COM1",9600);
    serialPort.Write(new byte[] { 0x01, 0x02, 0x03 }, 0, 3);

Then build that program and try running it from the command line.


Thanks. Will try that the next time I want to package that operation into a nice utility like that. For now, I’m putting DLL calls in my script. The command line program that can be called from another app is preferable - a ‘lite’ solution.

I’m surprised Pololu is recommending this though - considering the tutorial on GUI and interfacing uses cygwin. On the other hand, it’s understandable, since that example is out of date - doesn’t build any more - something about WinMain_16 missing or something like that.

Once someone writes a program that one can call with options like

prompt > write_COM -b 38400 -config 8N1 -COM 4

The whole world will have a ‘lite’ solution.