beautypg.com

Pololu Orangutan SVP User Manual

Page 31

background image

There are many free terminal programs available, including

PuTTY

[http://www.chiark.greenend.org.uk/~sgtatham/

putty/]

(Windows or Linux),

Tera Term

[http://hp.vector.co.jp/authors/VA002416/teraterm.html]

(Windows), and

Br@y

Terminal

[http://sites.google.com/site/terminalbpp/]

(Windows). To use any of these terminal programs, you must

specify the port name determined above, and the baud rate.

PuTTY is a free Windows terminal program that can send and receive bytes on a

serial port.

If you need to send and receive non-ASCII bytes, you can use the

Pololu Serial Transmitter Utility for

Windows

[http://www.pololu.com/docs/0J23]

.

Advanced users developing scripted applications may prefer the free terminal program

kermit

[http://www.columbia.edu/kermit/]

(Windows or Linux).

You can also write a computer program to use the serial port. The freely available Microsoft .NET framework for
Windows contains a SerialPort class that makes it easy to read and write bytes from a serial port. Here is some
example C# .NET code that uses the TTL Serial Port:

// Choose the port name and baud rate.

// Port name must be determined from the Device Manager.

System.IO.Ports.SerialPort port = new System.IO.Ports.SerialPort("COM4", 115200);

// Connect to the port.

port.Open();

// Transmit two bytes: 0x61, 0x62

port.Write(new byte[]{0x61, 0x62}, 0, 2);

// Wait for a byte to be received on the RX line.

int response = port.ReadByte();

// Show the user what byte was received.

MessageBox.Show("Received byte: " + response);

// Disconnect from the port so that other programs can use it.

port.Close();

Pololu Orangutan SVP User's Guide

© 2001–2012 Pololu Corporation

9. Using the TTL Serial Port

Page 31 of 37