Author
Topic: Using the serial monitor (Read 2 Times)
Role
Posts: 1
Points: 0

This post will serve as a guide to using the serial monitor as a debugger for program code. 

 

Starting the serial monitor

To start up the serial monitor, click the button at the bottom of the code editor window within IronCoder. This will launch the window containing the main serial monitor platform.

Serial monitor interface

Once the serial monitor is open, a panel with a plotter will be visible on the left side of the window and a side panel with different settings for initiating a serial connection will be present on the right side. Within the side panel, there are dropdowns for selecting the device, baud rate, parity, data bits, stop bits, control flow, and timeout. A connection indicator circle will be shown near the top right side of the window, with a red circle and loading icon indicating no current connection.

Programming the device

In order to successfully use the serial monitor, users must have a physical hardware device programmed with these specifications in mind. The data being transmitted should be of UTF-8 type, and values should be separated by commas in order to be correctly processed. This means that alphanumeric tranmissions should be accepted by the serial monitor and plotted in the order in which the inputs were sent.

 

Available device list and making a connection

Within the device dropdown, a list of devices currently plugged into the user's computer will be available to choose from. In order to successfully connect with the serial monitor, a device must be selected. If the connect button is pressed with no device selected, a warning window will pop up, prompting the user to select a device before a connection can be made. Once a device is selected, configure the other settings to match those with which the physical board has been programmed. When everything has been configured to the desired specifications, press the connect button to initiate communication between the serial monitor and the device.

 

Connection initiated

Once a connection has successfully been made, the connection indicator circle in the top right will become green and the loading circle will not appear. The fields for configuring the connection settings will be locked from editing to prevent any changes from occurring while a connection is active. The terminal will write a message indicating that a successful connection has been made to the specified COM port and baud rate. The data will be drawn onto the plotter, using the order in which the data was sent as the x-axis and the value as the y-axis.

 

Customization options

The color of the data plot can be changed using the color selection window, found within the settings dropdown on the side panel of the serial monitor. The dataset label can be changed using the interactive text box found with the dataset section of the side panel. This shows the color of the dataset and the label that is used for the key in the upper right hand corner of the plotter.

Terminal window

The terminal within the IronCoder code environment will output updates from the serial monitor at key stages, including when it is first opened, when it connects to a device, including the connection settings, and when the serial monitor is closed. This ensures a seamless experience where users can track the status of their usage of the serial monitor in real-time.

 

Disconnecting

Once the user is done using the serial monitor, the device can be disconnected using the same button that was made to initiate the connection, which should now say "Disconnect" instead of "Connect". Pressing this button or simply unplugging the device from the computer will cause the serial monitor to disconnect.

 


You need to login to comment or reply!