Serial Monitor

Receiving the Output from Your First Patch

In the previous section, we created our first Ardestan patch and then compiled the patch/uploaded to the Arduino. However, we still haven’t seen anything yet. To see what your program does, let’s click the ‘Serial Monitor’ tab and see the Serial Monitor window in the Ardestan IDE (Figure 1).

Figure 1: The Serial Monitor window.

You see the ‘active’ checkbox on the top left of the Serial Monitor window. Let’s click it as shown in Figure 2. By doing so, we can see the input from your Arduino inside the Serial Monitor window.

Figure 2: activating the serial communication..

Now, You may have seen a message printed out by your Arduino: “Hello, world!” in the Serial Monitor window (Figure 3).

Figure 3: a message received from the Serial output from your Arduino.

If you don’t see any, just reset your Arduino by pushing its reset button on board. If you push it again, then you will see one more “Hello. world!” message inside the Serial Monitor. You can repeat this as many as you want (Figure 4).

Figure 4: More “Hello. world!” messages received from your Arduino.

What is a Serial Monitor?

Now, we are sure that our first Ardestan patch is working fine! Yet, you might still have one question: “What is a Serial Monitor?” at this point, if this is your first experience with the Arduino. So, let’s learn what it is now.

To use an Arduino and upload a program, you need to connect your Arduino and computer with a USB cable, as you already know. Via the USB interface, your computer can ‘talk’ to the Arduino so that you can upload an Arduino program.

This USB connection can be also used to let your Arduino program communicate with the Ardestan IDE (or other software on your laptop). This is what we have done in our first Ardestan patch, and our program used the serial output via the USB interface to let the Arduino output the message to your Serial Monitor window.

Figure 5. Serial Communication

As shown in Figure 5, when a serial connection is established between the Arduino and your computer, The data that your Arduino output at its serial output is received at the serial input of your computer and vice versa. Then, what ‘Serial’ means? At this point, just simply think that it is called ‘serial’ as the communication between your Arduino and computer is by sending just one bit at one time (conversely, if the communication is performed by sending two more bits altogether simultaneously, it is called ‘parallel’).

It is also required to coordinate the speed of the serial communication by making it sure that the both sides (your Arduino and your computer) communicate. Hence, we need to set the ‘baud rate’ (the speed of the serial communication) the same on both sides. In Figures 1, 2, and 4, you see the baud rate is set to 9600 bps (bit per second) on the side of the Serial Monitor (on your computer).

Figure 6: Your first Ardestan patch (reproduced from Figure 9 in the section: Your First Patch).

Similarly, as shown in Figure 6, the ‘serial’ object is given the number 9600 after its object name (such a value is called ‘an argument’ in Ardestan. We will learn about this a bit later). This sets up the speed of the serial communication (baud rate) on your Ardestan to 9600 bps.

Now we learned that we are using the serial output from the Arduino to send out the message “Hello, world!” (which is received by the serial input of your laptop and shown in the Serial Monitor window). In the next section, we learn about the other part of our first patch.

Next: Depth-First Message-Passing

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s