Open and closed electric circuits, variables as properties of objects in object oriented programming and manipulation of broadcasting messages.

From 12th to 20th of February 2019 with the students from the class I teach we did an activity described below. The duration of the activity was 35-40 minutes.
Students built a program that implements open and closed circuits. As described in the link below:

In this way they learned about the variables as properties of the objects, as well as using messages to communicate between the objects. The on variable determines whether the switch is on or off, and thus the state of the circuit. This exercise aims to make students familiar with the concepts of object-oriented programming. It also aims to help them understand the concepts of physics of the power source, the switch and of the open and closed circuits.

They started with the following program and made the code to complete it.

On further consideration, I think it is a good idea to follow the previous activity with the activity below or vice versa.

The buzzer is connected to the micro:bit and the micro:bit is connected to the power pack or the computer. So a circuit has been made. It goes from the P0 down to the positive terminal of our buzzer and from the buzzer it goes to the ground.

Then the micro:bit is loaded with the following code:

On button A pressed

digital write P0 to 1 * that turns P0 on

On button B pressed

digital write P0 to 0 *that turns P0 off

Therefore by pressing buttons A and B, we have a closed and opened circuit. When it is closed electric current passes through the buzzer and we hear a sound and when it is open no electricity passes from the buzzer and it is silent. An LED could be connected instead of a buzzer.

Vasiliki Servou, at Kareas High School, Athens, Bironas, Greece
This entry was posted in 2019, Teaching by vasilikiservou. Bookmark the permalink.

About vasilikiservou

I am an ICT teacher with 22 years work experience in the field I love teaching and I have the following qualifications: An honours degree in Physics from the School of Exact Sciences of Aristotle University of Thessaloniki, 1991. A Master's Degree of Science in Computer Science, University of Dundee, Department of Mathematics and Computer Sience-U.K., 1993. A master in Educational Studies (Continuing Education), Open University of Cyprus, Nicosia, Cyprus, Distance Learning Course, 2012. Certificate of Proficiency in English, University of Cambridge Local Examinations Syndicate, 1996. I am also Certified in the use and exploitation of ICT Research in educational teaching process Ministry of Education, Research and Religious Affairs, Decision of General Secretary of Ministry of Education and REligious Affairs 12690/09.11.2015

Leave a Reply

Your email address will not be published.