{"id":9762,"date":"2015-03-24T14:01:40","date_gmt":"2015-03-24T03:01:40","guid":{"rendered":"http:\/\/legoeng.local\/?p=9762"},"modified":"2022-07-18T15:51:49","modified_gmt":"2022-07-18T05:51:49","slug":"inside-a-two-step-simple-line-follower","status":"publish","type":"post","link":"http:\/\/legoeng.local\/inside-a-two-step-simple-line-follower\/","title":{"rendered":"Inside a Two-Step Simple Line Follower"},"content":{"rendered":"
<\/a>In this unit, we will use the datalogging tools available in the EV3 Software to study the internal operation of a two-step simple line follower with one Light sensor. It is a very simple but powerful example that can help students to understand and to correctly program other situations.<\/p>\n One of the most important functions in both robotics and computer science is the capacity to record information to analyze it in real time or later on. Although it is possible to use the EV3 brick\u2019s screen to display messages and sensor readings, it is not always possible to stop the robot to read its screen. In those cases, we need either to record the data to analyze it later, or display data in real time on the computer, if it is connected to the EV3 brick.<\/p>\n This unit explains in detail the concept of datalogging by means of manually accessing files, the management of these files from the EV3 Software using uploads and downloads, and their subsequent query and analysis. We will use data conversion, logic, and data wires to control the program flow.<\/p>\n It also takes advantage of the datalogging feature within the EV3 Software to automatically record data and visualize it graphically in the computer screen. This capacity to generate and relate the sensors\u2019 readings to different curves as a function of time can be extremely useful in many and diverse situations.<\/p>\n Finally, it should be mentioned that the datalogging can be a very useful way of debugging a computer program, given that, in many occasions, it allows to understand much better the program flow and the reasons of its decision making process, like for example, how a switch works inside a loop.<\/p>\n This unit is based on my \u201cTeachers Introduction Course to LEGO\u00ae Mindstorms NXT & EV3<\/a>\u201d at BOGATECH<\/a>\u2019s website, where you can find NXT versions of these programming examples and the differences between the NXT and EV3 versions, if you are interested.<\/p>\nExercise overview and preparation<\/h2>\n