Welcome to the Parallax Discussion Forums, sign-up to participate.

# Scribbling sport team logos with S2, using Microsoft Excel

Posts: 604
edited October 2014
Hello everybody,
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 hadnt 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 dont 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

• Posts: 21,129
edited January 2012
Nikos,

'Spectacular achievement! My mouth is agape! I never would have thought to use Excel to write code. Congratulations, and thanks for sharing your Excel file!

-Phil
Perfection is achieved not when there is nothing more to add, but when there is nothing left to take away. -Antoine de Saint-Exupery
• Posts: 197
edited January 2012
That was far out. Awesome contribution. Thanks for sharing it.
• Posts: 604
edited January 2012
Thank you guys,

Phil and Parallax have done excellent work with S2! As a teacher I have to say that S2 is the perfect robot for an educational curriculum. From my experience I believe that students on Lyceum, dont like very much cables end wiring connections neither complicate programming code. On the other hand they love to see a robot doing amazing things like scribbling and roaming. S2 is all in one. No cables, all sensors build in, strong and easy to carry, friendly programming environment and finally the cost (comparing with other educational robots). The cost issue is very important especially here in Greece after the recent financial crisis. Phil congratulation for your work and the supporting open code! I'm sure that I' ll need your advice very soon because I want to make my S2 able to execute commands in Logo language! On 30rd of March 2012 there is a conference for ICT teachers here in Patras. I intent to make a presentation and demonstration of S2 in the teachers community as they are not very familiar with this new product!
• Posts: 21,129
edited January 2012
Thanks, Nikos! I'm glad the S2 is working out for you so well.

BTW, my contribution the the S2 project was mainly the software, with only minor consultation on the hardware design. The hardware heavy lifting was done by Ben Wirz of Element, Inc., in Colorado. His company also did the design for the plastic enclosure, and he handled the arrangements for manufacture in China. Ken Gracey managed the project and brought in staff from Parallax, including their very talented art department, as needed. It all added up to a great team to be part of.

-Phil
Perfection is achieved not when there is nothing more to add, but when there is nothing left to take away. -Antoine de Saint-Exupery
• Posts: 6,013
edited January 2012
Nikos, most awesome explanation. I will be using the S2 with middle school students starting March 1st, and I'll be very thankful to have these examples to do precision drawing. You guys are making it all so easy - start with Jessica's video, move to Nikos' examples, and here we are!

Nikos, please PM me so we can get in touch about the Propeller BOE this weekend.

Thanks,

Ken Gracey
• Posts: 1,074
edited January 2012
Nikos...

That is totally cool!!!! I need to get my S1 programmed to scribble "WOW!" in tribute. ;-)
Keep up the good work!

Amanda Ward
Founder of the "Society for Aimless Tinkering and World Conquest"
• Posts: 604
edited January 2012
Well guys,

Here is a set of 3 examples:

Clover: made by me and my student Nodas.

There are the excel file with the coordinates, and the exported spin code. You can play with the size using the excel file or make changes and improvements and you can take a different spin code.
Enjoy these activities! I would be glad if you could send back photos on forum from any event running these codes with your S2 robots!
• Posts: 490
edited January 2012
Nikos,

This is amazing!! What an incredible combination of programming tools, this makes drawing with the S2 so simple.

Great work!

Cheers,
Jessica
Allons-y!
--
@jessicauelmen
• Posts: 18,324
edited January 2012
Αυτό είναι φανταστικό, Nikos!
"When you make a thing, a thing that is new, it is so complicated making it that it is bound to be ugly. But those that make it after you, they don’t have to worry about making it. And they can make it pretty, and so everybody can like it when others make it after you."

- Pablo Picasso
• Posts: 3,688
edited January 2012
Great work Nikos! You and your students deseve a gold medal...

The heart and arrow is just in time for Valentine's Day!

Keep up the great work.
Whit+

"We keep moving forward, opening new doors, and doing new things, because we're curious and curiosity keeps leading us down new paths." - Walt Disney
• Posts: 9,666
edited January 2012
Nikos,

'Spectacular achievement! My mouth is agape! I never would have thought to use Excel to write code. Congratulations, and thanks for sharing your Excel file!

-Phil

I must echo Phil's response.

Thanks so much for sharing!

Jim
Infernal Machine
• Posts: 604
edited February 2012
Hello guys,

Your responses make me feel on top of the word!!!
I keep trying to improve the scribbling method with S2 and Excel and I have some useful notes with symmetrical shapes.
Before I share with you these findings I would like to explain the multitasking example which we program the S2 to play music as it scribbles the sport team logo.
In order to achieve this challenge I used the object file: simple_multicore_template.spin from AN011 Parallax Semiconductor Applications Notes
The only I had to do was to create the music file of Olympiakos and Panathinaikos theme songs in spin code. I used the Scribbler Program Maker (S2 v1.3)

Although I used to play guitar many years ago Im not very good at reproducing the music tones hearing a song. So I asked my nephew Leonidas who plays piano, to hear the athletic marches and put the appropriate notes in the Scribbler Program Maker environment. When I had the notes on the Scribbler Program Maker I pressed the view the propeller program button and I got the spin code. The spin files with the result code are: pao_logo_music.spin and Olympiakos_logo_music.spin.
I also send you another example with title: apple from my student Thanos, and a power point presentation that explains the coordinates conversion to spin with the excel file.
• Posts: 6,013
edited February 2012
Nikos -

For a local group of 34 7th and 8th graders I'm instructing these examples couldn't have come at a better time.

I've got you in the queue for a couple of PropBOEs along with two S2 robots. Let me know if you want the S2s ahead of time.

Sincerely,

Ken Gracey
• Posts: 692
edited February 2012
Thats what I like about Parallax (Mr Gracey)

At any time Ken just gives away stuff to people to do more amazing things with.

Thanks Parallax and Ken for providing such a great product and support to all of us.

John
• Posts: 604
edited February 2012
WOW!!! Ken!!! Of course!!!! This is AMAZING!!!! The s2 has become the center of attention for the students in my school. Every day they bring me new shapes and logotypes to try with s2!!! A couple of S2 robots will make teaching easier and will give us the opportunity to do more amazing things!
• Posts: 6,013
edited February 2012
@Nikos, these will be as a "gift" to reduce customs, which is exactly what they are considering we are thanking you for the contribution. These might go slow or quickly depending on what shipping method our sales staff uses (they'll choose the best one). In either case they'll be on an airplane by tomorrow.

Ken Gracey
• Posts: 604
edited February 2012
Ken Gracey wrote: »
@Nikos, these will be as a "gift" to reduce customs, which is exactly what they are considering we are thanking you for the contribution. These might go slow or quickly depending on what shipping method our sales staff uses (they'll choose the best one). In either case they'll be on an airplane by tomorrow.

Ken Gracey
Ken ,
Thank you very much !!!

You are a big heart!!!!

I hope to be able to do more interesting things with Parallax products!
You have built a wonderful world with excellent cooperators! The world of Parallax! The most amazing in this world is the people!!!
Keep going and inspire the people around you!

p.s. Im looking forward to receive the Parallax package!!!!!

Nikos Giannakopoulos
• Posts: 604
edited February 2012
Symmetrical logotypes- S2 & MS Excel:

The following two logotypes have a particular characteristic. They are almost symmetrical. The red axis on the middle of each shape divides the shape into two almost identically parts. I said almost because they aren’t a 100% symmetrical. As you can see in the first logotype the left side of the skull is not exactly the same as the right size of the skull and in the second logotype the left eagle catches a sword and the right nothing. However we can use this fact in order to scribble easier these shapes with the S2 robot and Microsoft Excel!

The only we have to do is to find the coordinates and the spin commands of the one half of the shape and then using the MS Excel we can find automatically the coordinates and the spin commands of the other half. If we have a point A(x,y) and C is the x-intercept of the symmetry axis, the coordinates of the symmetrical point A’(x’,y’) are: y’=y and x’=2*c-x . Ms Excel gives us the opportunity to find extremely easy these coordinates.
In the next step I will present two strategies in order to scribble these shapes with S2 robot.

Nikos Giannakopoulos.
• Posts: 604
edited February 2012
Let’s go to scribble the logotype of “AEK” (this one with the two symmetrical eagles)

This logotype is more suitable for the first strategy:
According the first strategy the S2 start its path from the point 1 that is belong on the axis of symmetry (red axis) and it scribbles the left half of the shape as it is showed by the small red arrows. This path has a set of 53 points which is the only set of points we have to calculate in order to accomplish the whole shape. When S2 arrives in point 53 will continue to scribble the right half following the path which is indicated by the green small arrows. As you can see the S2 will draw the string of symmetrical points in opposite order than the original points. You can also see that S2 keeps the way that scribbles the symmetrical arcs. If the original arc is clockwise the symmetrical it is also clockwise and if the original arc is counter clockwise the symmetrical it is also counter clockwise (the height of the arc doesn’t change).
So if we have all the data for the left half shape , in order to find the correct data for the right half shape we must do the following:
Step1: we copy and paste the columns: num,x,y,arc and h, in the blank area next to the "spin command" column next to last point 53

Step2: Select the area you’ve just copied from step 1 and sort the selected area in descending order according the first column (num). The 53 point will come first and the 1 point will come last.

Step3: Copy the “ARC” and “h” column and paste them one cell down. In fact we make a shift one position down.

Step4: In this step we are ready to create the coordinates of the symmetrical points. In cell J55 we write the type “=2*11,5-V55” which is the formula X’=2*C-X that give us the symmetrical X coordinate. We copy this formula into all the following cells. So we have automatically the X’ coordinates of all the symmetrical points!

Step5: We copy the Y, ARC and h columns and we pate them next to the X’ column
In this step if our shape is 100% symmetric we have finished.

If the shape it is not 100% symmetric (like the ‘AEK’ logotype) we add or we remove the differences

Step6: In the above example we must remove the commands 73,74,75,76 for the right sword because the logotype doesn’t have a right sword. Then select whole the spin command area (don’t worry about the blank lines) and press the button to get the spin code.

Here is the result: what exactly scribbles the S2 robot.

I also send you the spin code and the excel file with all the above steps in separate Excel sheets. Feel free to make any questions or improvements!
BTW the second strategy for symmetrical shapes that I will suggest, is by far easier than the first one but we can’t use it in all symmetrical shapes. In the next post I’ll present the logotype of “PAO” with the skull and the two wings, which is one shape we can use both strategies.

Nikos Giannakopoulos
• Posts: 604
edited March 2012
Before introduce the second strategy in order to scribble symmetrical shapes, I’ll give you another example: the “Puma Logo” created by my student Leandros, and one update of “Eagle_aek” logo created by students Philipos and Hero.

I also send you some unsolved examples very useful for teachers.

Working on symmetrical shapes and trying to improve the scribbling method, I ended up that the existence of a pen lifter on S2 robot will expand the abilities of the robot.
The wonderful gift (the s2 robots) from Ken Gracey gave me the chance to experiment more with the robot. So an amazing S2 pen lifter kit is in the pipeline and I make an effort to create a video for the assembly and installation instructions in order to share with you.

Stay tuned

Nikos Giannakopoulos
• Posts: 604
edited March 2012
Hi,

I came back for the 2nd strategy in order to scribble symmetrical shapes with S2.

According the second strategy the robot scribbles the first half of the symmetrical shape and before goes for the second half it must return at the same point where the first half started.
In the following shape you can see that for the first half, S2 uses 86 steps and in the 86th step it has returned again in the start point. Then it is ready to scribble the symmetrical 2nd half shape using the rules x=2*c-x, y=y (the same as the 1rst strategy) and Arc=-Arc (because in the symmetrical shape it scribbles the arcs in the opposite direction than the first half)

It is very easy to create the commands for the symmetrical in the excel file. Just copy and paste the above formulas in the cells for the symmetrical points. You can see the "wings_skull_test.xls" file.
Here is a first attempt to scribble the wings and skull using this method.

I convinced that this shape is too complicate and the use of a pen lifter is essential..

Nikos Giannakopoulos
• Posts: 3,688
edited October 2014
Amazing stuff Nikos - Great to re-visit this tread! Thanks for posting the link again!
Whit+

"We keep moving forward, opening new doors, and doing new things, because we're curious and curiosity keeps leading us down new paths." - Walt Disney