Connecting PApplet with system logic