Hello World application

Let’s start with the Pumbaa “Hello World” application. It examplifies what an application is and how to build and run it.

It consists of two files; main.py and Makefile.

main.py

main.py is the main script of the application.

print("Hello world!")

Makefile

Makefile contains build configuration of the application.

NAME = hello_world
BOARD ?= linux

PUMBAA_ROOT ?= ../..
include $(PUMBAA_ROOT)/make/app.mk

Build and run

Compile, link and run it by typing the commands below in a shell:

$ cd examples/hello_world
$ make -s run
<build system output>
Hello world!
$

Cross-compile, link and then run on an Arduino Due:

$ cd examples/hello_world
$ make -s BOARD=arduino_due run
<build system output>
Hello world!
$