Going Further

A shortened version of the above video is available HERE.

All of the programs you have seen so far on this site have been very short for reasons of clarity, and have therefore not been very impressive. In this section we will show you some more advanced EV3 Basic programs, which we hope will impress you more. We will include some programs that take advantage of the extra power that EV3 Basic offers compared to the standard EV3 software.

One weakness of the standard EV3 software is its limited handling of text strings - all it can do is join text string together (i.e. 'concatenate' them). So an EV3 Basic program that works with text might be a good place to start. Let's make a program that allows us to build a text string using the EV3's LCD screen and buttons, just like you have probably already done when you entered a WiFi or Bluetooth password on the brick. This program doesn't have any robotic element itself but we will use it later to create a text string to be written out by a 'writing robot' that we will develop.

Although the ultimate aim is to develop a writing robot, it would be unwise to start working with a real robot writing on real paper because we are likely to waste a huge amount of paper and ink as we slowly develop our solution. So why not first have the Small Basic turtle drawing the characters for us. That way we can work out what moves are needed to draw each character, and we can learn some new Small Basic skills on the way.

In part 1 it becomes obvious that if we want our turtle to be able to trace out every capital letter and every digit (36 characters in total) then our code could become very long, with a lot of repetition of long lines of code that make the turtle move or turn. Let's try to substitute a single character for each of these lines so that the instructions for drawing each character can be expressed neatly in a single string on just one line.

In part 3 we extend the code of part 2 to include sequences for every capital letter A-Z, every digit 0-9, as well as the space and hyphen characters. This program waits for you to type a character which the turtle then draws for you. When the turtle has finished drawing then you can try drawing another character.

In this project we will design a pen attachment for the standard Lego 'driving base' model. This will include a medium motor that will lower the pen onto the paper when appropriate, and lift it off the paper when not needed. The design will make the pen touch the paper at the midpoint between the wheels - this will make the code much easier to write because it means the pen tip will remain stationary when the robot turns on the spot.

The first version of the writing robot will write a fixed text: "EV3". However, it will be possible to easily scale the written text to any desired size by modifying a single line of the code. This scalability will give our writing robot an advantage over 'plotter' designs, but our writing robot will not be able to match the accuracy of a plotter.

In this project we will combine the previous projects into a single program that will allow the user to enter a text string at runtime that will then be written out by the robot.

Version 2 of the writing robot was not very accurate. Let's see whether we can use sensors to help us make more precise turns.