Week 7 – 2019 – James

Hi guys, if you’re wondering why we haven’t written for a week, it’s because of Dad looking after me. (I was sick last week). Anyway, I worked on my can finder (again).

The last one I showed you (Back in week 6) was partly done. But now, I’ve done more on it and put more comments in. Here is a reminder of what my last weeks one was compared to this weeks.

My last weeks can finder code. Note: the last loop hasn’t been tested or uploaded yet.
This weeks can finder code. Note: The “My Block” at the end just slowly ramps the speed up when pushing the can out by adding 0.01 to the speed every time the code goes around the loop.

As you can see, I’ve made a new variable and a new “My Block” which i’ll explain about now.

The new variable is called “turn_angle”. It stores the number of degrees to turn for every increment. The new “My Block” is called “speed_adder”. It increases the speed by 0.01 every time the is repeated in the loop. Inside the “My Block” uses an addition block which puts the speed up by 0.01.

I can’t show you the code inside it since I haven’t got a screenshot of it.

This is what happens when I run my new code. When the robot gets up to the silver strip, the robot finds the can. Next it turns in five degree increments till the robot cannot see the can. Next you have to do some maths. The maths is how many increments were turned till the robot didn’t see the can. Divide this number by 2. Multiply this number by how many degrees in an increment. In my code an increment was five degrees.

I left it at five degrees because it worked quite nicely. However, the robot appeared not to turn the opposite direction as much as expected. I’m going to look at it next week to find a way to make sure the robot lines as straight up as possible with the can.

That’s it for today’s post. But for now here is the word and phrase of the day.

Abet: To help, encourage, or support someone in a criminal act.

The true competitors are the ones who always play to win – Tom Brady