Physical computing applied to introductory programming

Learning to program can be very difficult for students, since they must master language syntax, programming theory and problem solving techniques in a short period of time. A non-traditional approach, like physical computing paradigm, might help students to overcome these difficulties. This paradigm takes the computational concepts “out of the screen” and into the real world so that the student can interact with them.

Following this paradigm we designed different learning modules -to be used in lectures and laboratory sessions- to teach C/C++, MATLAB and Python. Lecturers explain a computational concept and, afterwards, reinforce it using the physical computing modules. For example, conditional structures are illustrated using a photocell and several LEDs, arrays are explained using musical melodies, etc.

We have used these modules in several introductory programming courses for science and engineering students obtaining very good results: more students learnt to program and more students enjoyed programming. You can read a brief description here.

Another interesting result is that the use of these module reduces -actually closes- the gender gap when learning to program. This is a hot topic because there is a strong gender inbalance in computer science with women representing less than 20% of new computer science graduates. The use of these module might be a useful tool to enhance women perceptions on programming. We have published our results in Computers & Education. You can find the published paper here (if you don’t have access to the journal you can find the accepted paper here).

Here you can find a detailed description of the developed material and the necessary libraries. If you find it useful tell us (, please.

Download the document which explains the design’s details of demo lectures using Arduino. Examples are in C++.
Download the document which explains the design’s details of lab sessions using Arduino. Examples are in C++.

Lab sessions
Lab script for the Ardunio session using Python (in spanish).
Lab script for the Ardunio session using Matlab (in spanish).

Developed code
Code in C++
Code in Matlab. It is necessary also to download the MATLAB Support Package for Arduino.
Code in Python

If you are new to Physical Computing but feel that it could be useful in your classes this is a good starting point.