Week 5 – Oliver

This week Richard had a challenge week with me and James only. We had a list of pseudocode instructions to make the robot follow, shown below:

1. Move forwards in a straight line
2. If a red, green or a yellow tile is detected stop and wait for one second
3. If the tile is red, stay stopped
4. If the tile is yellow, move forwards until it is not yellow and go back to 1
5. If the tile is green, wiggle side to side 3 times and go back to 1

This is a lot harder than it may seem. We had to use many different block types to make the program work, and I feel like I have learned something new to try on my robot at home.

My code is still not perfected, but this is my unfinished result. I have written step by step of how my program works:

  1. Move forward until one of the three colours is found.
  2.  Wait 1 second.
  3. If the colour is red then stop motors, say “RED” and then go back to the beginning.
  4. If the colour is not red then if the colour is yellow then;
  5. Until the colour is not yellow move forward then go back to 1.
  6. If the colour is not red nor yellow and it is green then stop motors, run the My Block called “The_Wiggles” and then go back to 1.

I have used Nested Loops (loops inside each other) in my program. Right now, it does not work, so I wonder if I choose a different format of laying out my code it would work better? I am going to try that next week.

My Wiggle Block

This My Block starts by turning the robot 25 wheel degrees left by moving the wheels. It then repeats turning 50 wheel degrees left and right 3 more times. Then it finally finished by turning 25 wheel degrees right.

WORD OF THE DAY: Petrichor The smell when rain and soil combine.

Week 5 – James

Hi, its James here. We didn’t write last week because we only had 2 people here last week ): . (Oliver and Josh were away). Anyway, this week we finished a challenge that I did last week. Dad helped me because you can see that there is a yellow and red block is in the code. (We haven’t used those blocks yet). It took us 2 weeks to get it to work properly. If you’re wondering what the yellow and red blocks do it does this…

 

Week 4 – Rich

There are some students away this week so rather than progress with teaching I’ve set a challenge to try and put together all of the pieces we’ve looked at so far.

The challenge is:

There are four flat Lego tiles placed in a straight line 50cm apart.  One tile is red, one tile is green, one tile is yellow and one tile is blue.  The tiles can be placed in any order.

Write EV3 code from the pseudocode, below:

1. Move forwards in a straight line
2. If a red, green or a yellow tile is detected stop and wait for one second
3. If the tile is red, stay stopped
4. If the tile is yellow, move forwards until it is not yellow and go back to 1
5. If the tile is green, wiggle side to side 3 times and go back to 1

In your own blog posts for week 4, describe what you did today.  Show your EV3 code and discuss any problems you had.

Week 3 – Rich

Today, amongst other things, we discussed what pseudocode was and how important it was to use as a means to accurately describe what we want the robot to do before we write EV3 code.  The children discuss pseudocode, in a bit more detail, in their own posts.

The children looked at my EV3 code below, but it was not immediately obvious what the code did at all!  It would take a little time to follow it through and, if there was a block that was unfamiliar to them, they would need to research what it did before progressing to find the full intent of the code.However, by looking at the pseudocode I wrote before writing the EV3 code, the children quickly worked out exactly what the robot was meant to do and could relate it to the EV3 code.

1. Move forwards at a speed of 25
2. When the colour sensor detects a green or a red
     a. coast to a stop
3. Wait one second
4. If the colour is red:
     a. move backwards 240 degrees at a speed of 25
     b. turn right
5. If the colour is green:
     a. move backwards 240 degrees at a speed of 25
     b. turn left

Sometimes it’s useful to put the pseudocode in as a comment in your EV3 program, as below.

Use of pseudocode is something we will continue to develop as the childrens challenges become more complex 🙂

Week 3 – James

 

Hi – it’s James again. This is what happend in robotics class this week.

We discussed what pseudocode means and it means detailed steps that can be used to write actual code.  It could be written in a different language like French or Spanish or any other language in the world and is a helpful guide to not forget steps. Click here to see the others

After that, we looked at a PB+J sample of what to do to make a PB+J sandwich. ( PB+J means Peanut butter and Jelly incase you were wondering). There were 3 students and they wrote some pseudocode of how to make a PB+J sandwich. All there students were wrong but this is a solution below.

  1. Take exactly two pieces of bread.
  2. Take one piece of bread that is not covered with peanut butter on any side and use a knife to spread peanut butter on one side
  3. Take a second piece of bread that is not covered with jelly on any side and use a knife to spread jelly on one side
  4. Place the jelly side of the second piece of bread against the peanut butter side of the first piece of bread
  5. Place the combined pieces of bread on plate

Next, we had a challenge using pseudocode to get around a square going left around the square. Richard said that I had the best code. I also was the first one to do it. The code I wrote is down below.


The pseudocode challenge was very hard because it took like 15 times to make it work. Thats how hard it was. So now, our adventure continues.

Week 3 – Josh

This week we discussed what pseudocode is and what it can do for us as programmers.  Pseudocode is what coders use to plan or explain an idea without actually coding it.  An example is if I wanted to make my robot go forward and then flash its lights blue and red.  This could help a fellow coder understand what I am trying to achieve while I have a clear plan in front of me.  We then look at the Peanut Butter and Jelly example and discussed what we could do to refine it and make it better.

Goal: Robot needs to go once around a square box. It starts at the line and faces north.  It will end on the line facing north.
Step 1: Go forward 10 inches
Step 2: Turn left 90 degrees
Step 3: Repeat steps 1 and 2 three more time.
We then attempted to code the EV3 to do this task.  It was actually an extremely difficult task.  As we had to figure out through guess and check how many rotations the wheel had to do, to do 90 degrees.  But now we have this information we can keep reusing it.  This will be very important information.
Our Mindstorm Adventures continue.

Week 3 – Brayden

This week during robotics class we began learning about pseudocode. To start with we discussed what pseudocode is. Pseudocode is detailed notes that are not in a specific language that a programmer can use to communicate their plan with others and review later to write their code. To learn this we looked at an example of students trying to write instructions to make a peanut butter & jelly sandwich which was then given to their teacher to follow. The 3 students who wrote the instructions did not write them very clearly which caused their teacher to fail at making a PB&J sandwich. After we looked at this example we moved on to attempting a challenge. For this challenge we had to make a robot go around in a square.

This is the pseudocode for the challenge:
Step 1: Move forward 4 wheel rotations
Step 2: Turn left 90 degrees
Step 3: Repeat steps 1 and 2 three more times

This may seem like an easy task but it was very difficult to get the correct amount of degrees to turn. After many attempts we decided to use port view to find the correct amount of degrees to turn. This is my loop of code that I used to complete the challenge:

We were then shown some pseudocode which we had to use to work out what the proper code would do.

Week 3 – Oliver

Today at coding we discussed pseudocode.

Pseudocode is like a simpler form of any programming language, used by programmers to picture in their mind what they want the robot to do.

We were given examples of “How to make a Peanut Butter and Jam Sandwich.” We had to give very detailed examples, or something would go wrong.

Sandwich pseudocode example.

We were also given a pseudocode example to try out on the EV3. The steps were:

  1. Move forward 4 wheel rotations
  2. Turn left 90 degrees.
  3. Repeat steps one and two 3 more times.

It was a lot harder than we expected it to be and required a lot of trial and error. Eventually, we decided to use Port View to get an accurate result, but even that wasn’t perfect. Our result for the turning was 210±5 rotational degrees (allowing for the wheels to slip slightly).

The final result.

WORD(S) OF THE DAY: REVERSE POLISH NOTATION. A way of doing mathematical equations without the need of brackets.

Example: 1 3 6 12 9 + is equal to 31.