Tech Blogging‎ > ‎


posted Mar 26, 2012, 2:17 AM by Haris Hashim   [ updated Mar 26, 2012, 4:02 AM ]


Last week, a student come to me with question about Arduino. After several communication through FB message and email. I finally pronounce that it is not Arduino problem. And the solution is flow chart!

I was split about this write up. Should it be under the Tech Bloging or Live Blogging category? Well, let's inject some live into tech! That is also why this is my first tech blog that start with ramblings.


There is this one Facebook page that I use to park my company present. As well as catch those people who search for Arduino in Malaysia through Facebook. I begin to think that this is not an efficient way of doing it (FB Group will do better). Yet in that particular day, a student found that page and begin to ask question.

The first thing not to do when asking such question. Is to dump all source code and expect me to reply. The second thing not to do. Is doing the first without making an effort to describe the source code. Zoom into the problem and identify which part of the code that is not working.

When both of this happen. It demonstrate that the code dump is not understood. Hence why it is not working. In that particular day I was right with this line of thought.

Right and Wrong

Arduino is damn easy. With lots of sample program on the internet. So let's put it on the table that many example code can easily be downloaded, studied and used. 

This is not wrong!

However, inability to understand how the example code flow and solve a problem. Will lead to codes being downloaded, not studied and used. 

This is wrong!

In this modern age, universities and colleges realized that programming have a far and wide reaching impact. It can be used to solve problem in multiple domain. Hence student is provided with subjects that taught programming. Some of this classes are in accelerated manner to allow student to have a quick grasp about programming and apply them in multiple discipline.

This is right!

However the accelerated nature means that some matter does not get proper attention. Either just a mentioned in a text book. Or something that hardly get addressed in the class. Mentioned it one time, have an exercise and boom! Move on to the next topic. And I have no idea why this happen to the matter of flowcharting technique.

This is wrong!

Because without emphasizing in such technique. Those beautiful codes is just texts without meaning. Codes, which are very useful in teaching student doing programming. Will become useless if it cannot be studied. But to study it the student need to use flowchart as a tool. A tool that teach the concept of program flow.

Program Flow

So, several email later reveal that the problem is not Arduino specific. But the inability to understand the very concept of programming it self. 

So on Sunday. I invited the student just for a flowcharting session. With understanding that I will not give final solution in form of code.

The first thing that I did is to use game concept to bridge the understanding between image and flow. In the form of a hastily drawn treasure hunting map with the following story line.
  • A group or student have a starting point.
  • They should find a mosque as their first check point. If the mosques is not found, it is OK to go back home.
  • They should run around the mosque 3 times, at every time checking in to the first check point.
  • On the third round they will be given something.
  • If that something is the treasure they can go home. Otherwise have to repeat again running 3 time around the mosque. Perhaps because too slow :D
The student is asked to draw over the map to indicate the flow of how above step is achieved. This is important as it leads to drawing of arrow that show movement between places or check point.

The part that I like most is running around the mosque is indicated by 3 different line around it. I found that when tracing loop in flowchart or source code. It helps to visualize the loop by drawing circle as many as the required iteration! Also symbolizing a virtual concept of iteration using physical drawn line.

The first thing that happened is that the student try to accomplish the task speedily. By just drawing one line from starting point to the last point. This is not a good idea as one line would not show arrow. And by doing it too fast, the lesson of flowchart is lost!

So concept of check point is introduced. Seeing arrows from check point to checkpoint emphasize that there is flow. While stopping at checkpoint slow things down a bit so that I can ask question about what is needed  to be done at that particular point! 

This give birth to the concept of choice. For instant, upon arriving at the first checkpoint, I can ask what should the treasure hunter do there. Should they ask whether they see a mosque or not? Or at each round around the mosque, should they keep track how many round already? After the rounds is done should they check whether treasure is given or not?


After above exercise is done, come the hard task of representing the treasure hunting activity as flowchart. I.e. drawing shapes that represents input, process and choice. And using this basic building block to construct a loop.

I have to admit that in such 1 to 1 dynamic activity. It is not just the one who being taught that get taught. For instance I suggest an incorrect condition to count the round. Which is if count is equal to 3. To add to this, initially we have no process to reset the count. 

So there we are laughing through our first infinite loop! When count is not reset, the next condition check will never be false. Hence the round around the mosque will happen again and again not seeing the stop condition.

This is when making mistake is not necessarily a wrong thing. I can see that much more learning is actually happening when mistake is made.A point when I can see glimmer of understanding finally creep through in the eye of the student. 

When the flowchart is done. I asked the student to retrace the step to be confident about correctness. Some people might miss this. But this is what we software developer called debugging. Albeit in a much basic form.

Repetition is Good

After the first flowchart is done. I draw another simple map with different task. And we go over the whole process again. We did this for another 2 problem. The last one is done in 2 stage. Where second stage is extending the first.

I found that this kind of repetition is good. I forgot to demonstrate several key concept and it got mentioned later. It is also very good to the student as they will learn more at each repetition. However the important thing is to make them understand instead of memorize. So in the second exercise, the student is allowed to refer back to the first's flowchart. But the third is done in a close book way.

This is important, more so in Malaysia. I remember even in my day. Students tend to memorize more than trying to understand what they are doing.

Analytical Skill

At one point the student ask me a question. I ask back, to find the answer without asking me. And show how to do it by tracing the flowchart that is somewhat modified to cater for doing something wrongly. For instant what if initialization code is inside the loop? If count is set to zero in the loop itself?

With respect to Arduino. There is two main function which is setup() and loop(). The question being why count have to be set to zero in setup instead of the loop.

So we trace the flowchart and observe the effect. This is where the analytical part happen. And I found this to be an important way to understand the flow. In future I would do more of this. In the style of introducing error into the flow chart or mutating the codes. And ask student to trace and observe the effect.

It also make me realize that if I do it in such a way and ask student to answer their own question. It will improve self confident if they got it right. But also make them realize the value of repetition, By making them repeat the process until they got it right! 

In Closing

The whole exercise just make me think about how to handle student request for help. In the beginning of my Arduino day at Homebrew & Technology. I am quite eager to meet student and see what they are doing with Arduino. Soon after, I was flabbergasted by request that does not even demonstrate effort to understand what is being done. More to the tune of "we buy stuff from you, so you have to help us".

Since then I just stop seeing student. It really hurt my eye to see them struggle with doing programming and claim that it is Arduino problem!

At the same time I do have the passion of helping other people. And at least, do have some of the pedagogical facility and tactic to approach this kind of "teaching" requirement. 

The best student I ever have is a student coming to me for knowledge of playing Ping Pong (table tennis). Well I am a student my self at that time. So the solution is to give him a study table made of wood (that just happen to be lying around at that time) that is pushed against a stone wall. And ask him to practice in such a small table. Have to admit that my first intention is to to conquer the "actual" Ping Pong table. With as less disturbance as I can get. But it does work and the guy did become better very fast!

So this will be my strategy moving forward (not asking student to play ping pong against the wall !!!). Those student who come to me asking about Arduino and have plan to dump a lot of codes in front of my eye ball. You guys better be top notch in programming.

Those student who are not, will not be rejected. But be prepared to spend a lot of time doing flow chart. I will not touch on your code or your final project requirement in a flow chart session. 

To be very clear. This requirement is for student only. Professional? Just come and bring a lot of money ;)