you can create a Gadgeteer app and see the main() initialisation. But you’ll need the full Gadgeteer framework to make this work - you can just write your own handler that is possibly more effective, especially if you’re on a resource limited device and have a big app ?