Week 2 – 2019 – Sara

Hello there !

This week at robotics we finally started doing our own codes. It was really fun, it was kinda hard at the start but then I got the hang of it.

We started of by writing pseudocode for the robot to make a square. This was my pseudocode…

Step 1 : Go forward 10 inches ( around 25 cm) Step 2 : Turn left 90 degrees Step 3 : Repeat steps 1 and 2 three more times

This was my finished code…

The first green block was to tell the robot to move forward for two wheel rotations at a speed of 50, the second block was telling it turn off its left motor but the right motor should keep going and turn 409 degrees to the left. Then repeat this three more times.

The hardest part was finding the right number of degrees it should turn, I started of at 300 degrees and kept increasing until I found a degree that it had turned perfectly.

At first I thought that if I put 90 degrees it would make a perfect turn, but no, because I was coding for the right motor it meant it had a longer way to turn than the left motor. And if I put down that the left motor should turn 90 degrees I think it wouldn’t have worked because it would have needed the right motor to come along with it and that would mean I would have to wright two different degrees for each of the motors.

Ok , goodbye I’ll wright again next week.