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.
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.