Now, let's talk about how data is output through a serial port. Arduino has a standard tool for this purpose which we have already used. Let's once again, look at the AnalogReadSerial example and pay attention to this serial begin 9,600 line in the Setup section. What exactly is the serial highlighted in bold orange font? This is a so-called "object". The object, which is proposed to us by Arduino library, during our course, we won't be concentrating too much on what objects are. You can read about this in additional materials. Let's just regard it as some black box. Supposedly, we know what it can give us. In other words, we know what we can communicate to its inputs and what we can get at its output. Well, this black box is the Serial object designed, to exchange data through a serial port. Physically, this data exchange happens either via a USB port, through which your board is connected to your computer or through pins 0 and 1 simultaneously. If you look at it attentively, you will see inscriptions RX and TX. They are also destined to exchange data. When we download a sketch it is conveyed through the same lines, that's why when you assemble your device, try to use pins 0 and 1 last, because when you download your sketch and something is connected to the pins, this can prevent your device from functioning correctly. Now let's have a look at what happens with this serial object. Can you see that after the period we have the word "begin" to which the parameter 9,600 has been passed? In reality this is what's known as calling a function. What we just did. For example, with analog read or digital write during week one. When we refer to objects, we often call them methods. In other words, serial object takes the begin method. It is created to establish connection with the second device, which in our case is a computer. It can be called through setup and this happens only once when the controller starts. On the other hand, the parameter that we pass 9,600 is the data transfer rate in BD, which shows units, equivalent to bps in digital data exchange. 9,600 bps is not a lot but quite enough to transmit our small amounts of data. If you wish, you can increase the speed to let's say 115,200 but you will hardly ever need it, anyway. Now, let's try to understand where we can access the serial object next. This already happens in the loop. So we have to call another method called "print in" to which we pass the sensor value parameter. This parameter is a variable used by us to save our data in it which we received from A-0 analog output. One can guess that the printing is responsible for outputting a line in the serial port. It needs to be remembered that it adds a line feed at the end of the line. Namely, there is one more print method which will output your data and will not be translating your line, whereas, the subsequent data will be output right after your data. Let's conduct a small experiment with you. We are just going to output some data through a serial port and we shall see what it will look like. I have prepared and experimental sketch for you. Let's see what I've written here. We have connection being established at the same speed and then the transliterated line Privet is output directly to set up. Communication in Cyrillic might not work out. So let's try to output Latin characters. Thus, at the beginning of the sketch, we will have the Privet word and then we will output a certain value in the loop with the print method. We got casually acquainted with one small but useful function, which makes part of the Arduino language. This function is called millis. It returns the number of milliseconds which have passed since the controller was started. This might often come in handy and you can see right now what it looks like. You will output the number of milliseconds which have passed since the controller was started. Then without translating the line you will output the following thing. Let me underline this. This is the so-called "escape sequence" and it's not going to be output in the same form as we wrote it. When the Port Monitor gets the backward slash, it will realize that this is the beginning of the escape sequence and it will output a certain symbol which we would not be able to write manually. This is a tab character. With it, you can easily format your output data for the serial port. In other words, we will output the number of milliseconds and then the tab character and it will look like a number of spaces. I've created a little delay of 0.5 seconds so that the data wouldn't be displayed too fast. The loop then begins again and outputs a new value which returns the millis. Let's see what it will look like. I'm going to start the Port Monitor. Privet 0 499 999 and then we can see the data which is output every 500 milliseconds. Sometimes, this number is increased by one millisecond because all the actions that the controller runs will also take some time. That's why sometimes an extra millisecond appears, which is later added to the output number. So now you understand how to output data to a serial port. Later this week, we are going to talk about how we can read data which is sent from a computer. For now, we've just figured out how our experiment works. The one we've been working on all this time. Now, I'm going to close the Port Monitor, you too, don't forget to do it. Once you're done with your data reading, as it might seriously disturb your work process when you are downloading a new sketch.