I recently bought from Parallax the famous S2 robot and one of the first activities I made, was the: Scribble Your Name with the S2 Robot by Jessica Uelmen.I became very exiting when I saw the accuracy of the S2! I introduced the S2 to my students and we scribbled together their names. They enjoyed the result and one of my students asked me to scribble a clover that was the logo of his favorite sport team PANATHINAIKOS. We worked together and after a lot of effort we achieved to make the S2 scribble the clover.
Then all the students wanted to scribble the logo of their favorite sport team!
Although they hadnt any experience with S2 and Spin language before, they became very enthusiast!
I shared them some piece of ruled faint paper and they started to do their drawings. They could find correctly the coordinates on their shapes but they had a difficulty to create the Spin code.
In order to help them I designed a Microsoft Excel File that could create automatically the Spin code from the coordinates.
Before I start to explain the method I would like to say that if we have to draw an arc it is not necessary to measure the W (the width of the base of the arc). Here is a small change in the formula that it was described by Jessica:
As you can see we can calculate the R of the S2.arc_to(x1,y1, R) command only using the coordinates of A and B and the height h of the arc. There are some calculation but dont worry because the Microsoft Excel make this automatically.
Here is how it works my method: Supposing we have to scribble a Flag.
1) We find the coordinates of the 8 points and we numerate them.
2) We put the coordinates X and Y of every point in the green area.
3) If the robot must scribble an arc we fill the "ARC " column (ORANGE AREA) with 1 or -1 only . We Put -1 when the robot scribbles the arc clockwise and 1 when the robot scribbles the arc counter clockwise. In both cases we must also fill the "h" column (PINK AREA) with the appropriate value. If we have to draw a line, we leave these two areas blank. The default size is 30 but we can also change it
4) Then we mark the result area using the mouse and we press the button (export to spin file) in the help area. After this we get a spin file ready to load it in to S2, using the Propeller demo tool.
Here is the logo of OLYMPIAKOS sport team a more complicate drawing which uses 85 spin commands created by this way.
Making the activity more attractive we can program the S2 to multitask playing the Olympiakos theme song while drawing the logo.
Here is the video:which you can also see from www.grobot.gr