Simplified main.cpp (which is on mbed).