Terminal Widget Help


Serial Terminal Help

Terminal Window

Help Index


Programming Help

Working with Serial Terminal is easy! Please read the steps below for how to use the Serial Terminal API.

How to create a Serial Terminal Widget Window

Before creating a Serial Terminal Widget Window you need to establish a serial communications connection to Omnia Creator first using the ILCore object. ILCore takes care of connecting to Omnia Creator using the fastest possible serial communications speed; that your microcontroller can run the Omnia Creator Interface Library code at so that you don’t have to worry about baud rates anymore.

With Omnia Creator, worrying about baud rates is a thing of the past!

Please note: you need to make sure that your serial port’s baud rate is set to Auto in Omnia Creator for the Omnia Creator Interface Library to work. You can also force your serial port’s baud rate to be another value in Omnia Creator for interfacing with devices that aren’t running the Omnia Creator Interface Library code.

To get started with Serial Terminal, first include the Omnia Creator Interface Library in your code (line 1). Then declare the ILCore and ILTerminal objects (lines 3 and 4). In your main/setup function initialize communication with Omnia Creator using the core.init() function (line 8). core.init() takes care of setting up serial communications with Omnia Creator for you. Once you’ve initialized ILCore DO NOT USE YOUR NATIVE SERIAL FUNCTIONS ANYMORE! If you need to receive or send characters use ILCore to do it for you. ILCore wraps around your native serial port and supplies its own functions to access your native serial port like read, write, print, println, etc. However, if you still want to write/print to your native serial port, this is okay and will not cause any problems. Any text sent by your microcontroller will be printed to Omnia Creator’s standard serial terminal if you use your native serial write/print functions or ILCore’s write/print functions. But, you need to use the ILCore functions for receiving serial data. Calling your native serial read functions will cause the Omnia Creator Interface Library to lose synchronization with Omnia Creator.

Please note: you can use the ILCore object to open dialog boxes on the computer and get the results. You’re not going to really ever need to type into the serial terminal to command your microcontroller anymore!

Next, after initializing the core object you can clear all the previous Widget Windows from Omnia Creator’s memory by calling core.clearAll() (line 9). Any open Widget Windows should disappear after executing this line of code. If you don’t clear previous Widget Windows from memory you can still keep adding data to them from your microcontroller. However, you’ll need to clear a previous Widget Window from memory if you change the Widget Window’s type when you initialize it in your code. Omnia Creator’s Widget Menu also has a Remove Widget command and a Remove All Widgets command for this purpose. Omnia Creator will print out debug messages when there’s a problem that you need to address.

Finally, you can create the Serial Terminal Widget Window by calling terminal.init(&core, “Hello World”) (line 11). The first argument to terminal.init() is a pointer to the core object. All you need to do is pass it &core always. Passing &core connects the child ILTerminal object to parent ILCore object. The second argument to terminal.init() is a title string for the Widget Window. You can make this string whatever you want. But, please try to keep it short. If you’d like a docked Widget Window call the initDocked() function instead of the init() function. This will create the Serial Terminal Widget Window as a docking window that can dock itself inside of the main Omnia Creator window. Otherwise the init() function will create the Serial Terminal Widget as a top level window.

After executing this code a Serial Terminal Widget Window should appear!

How to control a Serial Terminal Widget Window

Once you’ve created your Serial Terminal Widget Window you can control it by sending the following control characters using write():

How to send text to a Serial Terminal Widget Window

You can send text to the Serial Terminal Widget Window in three ways. The first by using write() which sends a byte or a string of bytes to the Serial Terminal Widget Window. The second by using print() which sends either the decimal, hexadecimal, binary, or octal string of a value to the Serial Terminal Widget Window. The third by using println() which sends either the decimal, hexadecimal, binary, or octal string of a value followed by a newline to the Serial Terminal Widget Window.

Other Things

UTF-8 characters and strings are supported.

New Line (‘\n’), Carriage Return (‘\r’), and Carriage Return + New Line (“\r\n”) line ending types move the cursor to the start of the next line and are handled correctly as long as the line ending types are not mixed.


User Interface Help

You can find information about user interface functions below:

Clear Screen

To clear the received text go to the File Menu and click Clear Screen. This will clear the received text.

Send Text File

To send a text file go to the File Menu and click Send Text File. This will send a plain text file through your serial port.

Save Text File

To save a text file go to the File Menu and click Save Text File. This will save the received text to a plain text file.