Thursday, June 17, 2021

Using flowcharts to prep for coding

 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.

2 comments:

  1. Great use of flowcharting to solve a problem.

    ReplyDelete
  2. Thanks Russel. We are on a learning curve together, me and my class.

    ReplyDelete