Coding GiggleBot Continued

In this post I’ll explain how we are trying to tackle basic turns which will be integral to make patterns.

To be able to turn in place, MakeCode uses the spin function. Since spin is in milliseconds we need to test how long it takes to make a 90, 180, and 360 degree turn.

I tried various times within the code below, only changing how long it would spin for and recorded my results within a table. I estimated the angle at which I turn by the angle the robot would draw running the code below.

Screen Shot 2018-12-05 at 1.40.43 PM

Screen Shot 2018-12-07 at 1.13.25 AM

These results can help me estimate making turns so that I can effectively build a pattern. For example, to make a 90 degree turn it should take between 350 and 400 milliseconds.

I applied the earlier pattern I tried to do with the estimated 90 degree turns this time with the code below:

And it worked!

Next, I will tweak the pattern and stick it in a for loop to make my running pattern.

That’s it for now.

-Arva Syed

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.