Last week, my intermediate class were looking at using flowcharts to plan coding. They planned the small sections of how the mBot has to behave to follow the black line. Blog post here
Today, we put together all the parts from the previous couple of weeks. The binary was used to code the mBots and the flowchart and code was all put together to get the final outcome.
The students then had a great time racing the mBots round the course, changing the speed variables and adding lights at every direction change.
My intermediate class are coding mBot robots. To get them into it, we have been just kind of launching ourselves in and doing "stuff".
To prepare for the "Follow the line" task (link to task on the class site here) we have been preparing so they know why the code is like it is and why the mBot is behaving as it is. Last week we looked at binary. We did an introduction to what binary is and some whole class activities and then we played some games so they got the hang of it themselves. (link to work here)
This week we looked at flowcharts and how they help you to plan a sequence of events that have to happen. Link to work on class site here. We went through the symbols and where to find them on Google Drawings then went through the "Do you take sugar" example. The class then had a go with the "Socks" activity themselves and we looked at using loops with the alarm clock example.
We then started to apply it to the following the black line main activity that they have to do. We went through the sequence that had to happen verbally first so they understood which way the mBot had to go in the four different circumstances.
both sensors on the black line,
the left sensor on the black the the right sensor on the white, t
the right sensor on the black the the left sensor on the white,
both sensors on the white.
We did the first two events together, then they had to do they second two themselves. It came together quite well as we were combining the binary work we had done, the flow charts and seeing where it all linked to the coding blocks. Seeing where the flowchart links directly to the coding blocks is good.
Here is my worked example, which I did on a google drawing. Maybe I should have done it on a presentation so each event could have its own page and be clearer to understand. Link to drawing here.
Next week, I want them to combine it all together and upload it to the nMot to see if it works. They will then understand why the numbers on the inputs have to be 0,1,2 or 3 and understand the flow of the algorithm.
My Year 7 coding class are learning to make their mBots become autonomous cars. Part of that is to use the infra red sensor underneath the mBot to sense and follow a black line. To do this, the students need to understand a little about binary.
We started today talking about how they counted.
They all started counting for me out loud.
Then I asked them to add two single digit numbers together in their heads. Easy peasy. Answers were shouted out. Then I asked them to add 9 and 23. This took a bit longer in the head, and fingers were twiddled and counted.
Then I asked them to addf 329 and 73 in their heads. Some got there.
This was then written as sum on the board and they were all comfortable again.
I asked them how we know where to put the 73 under the 329 as they are different widths / numbers of digits. They then told me about units, tens and hundreds. Their teacher at intermediate will be proud of them.
After they had mentioned the units, tens and hundreds, we talked about how we count.
The name was DECIMAL as it is based on 10's. Every step to the left is 10 times bigger. We put numbers in them place slots tos ay how many of them there are of each.
I then introduced a new counting method. BINARY.
I used the class light switch as an example. How many switch places are there? 2. The switch can be on or off. The lights can be on or off. There are no threes or fours or others numbers. It is yeas or no.
BINARY counts in multiples of 2. I put the columns up to show them the difference. Each step to the left is multiplied by two this time. We did a few numbers together till they got it.
Binary Games
The first game we played was in the car park outside. The students put themselves into teams of four for the four columns we had been using in our binary examples. They each had two pieces of paper. One with a 1 on it and one with a 0 on it.
I wrote down numbers on a card and held it up. The teams had to shuffle themselves with their paper to be sowing the correct value in binary.
Here is a slightly chaotic video ...
When we went back into the classroom, I had some binary games ready on my class site for them to have a go at.
I thought that they might not appreciate this lesson as we did not use the mBots today, so they go no direct coding done. They did play some of the coding games that I have on my site too, but did not code the mBots.
Next week I plan to "test" their binary knowledge to see if what we did today was ok. This "test" will be in the form of an online quiz / game so they don't feel tested.
I hope this was enough for them to understand why we have to use a bit of binary when we code our rmBots to react to the black line.