Hei there,
I was wondering, is there a way to send out a last osc message to an oled display after turning off the Bela?
I have a C++ project which is using the OSCSender class to pass the data to another program running in the background. Also, I have implemented a switch, as described in this post:
https://forum.bela.io/d/261-suggestions-on-adding-a-power-on-off-switch/22
My idea is: you press the button, than the display is saying "Bye bye" or something, than the Bela is turning off.

So I already tried:

  • send a last OSC message inside the cleanup() function -> didn't work
  • periodically checking for Bela_stopRequested() in the render() function and sending out the message if its becoming true -> didn't work

I was wondering, if it's possible to check periodically for the state of either pin P9.09 or P9.27 or both. Or is there a way to pass in some functionality right before the cleanup() function is called?

So you are sending to an O2O daemon?
You could add a couple of lines just before return 0; at the end of main() in O2O/main.cpp, I guess it should work.

ah wow, didn't think of that! It works! Thanks so much! 🙂

Now I'm just wondering. I tried to build the O2O project from the terminal and its always saying:

Building main.cpp...
In file included from /root/Bela/projects/O2O/main.cpp:4:
In file included from /root/Bela/projects/O2O/u8g2/U8g2LinuxI2C.h:5:
In file included from /root/Bela/projects/O2O/u8g2/cppsrc/U8g2lib.h:53:
/root/Bela/projects/O2O/u8g2/cppsrc/U8x8lib.h:47:10: fatal error: 'u8x8.h' file not found
#include "u8x8.h"

I think somehow it doesnt refer to the subfolder u8g2 where the "u8x8.h" file is placed in. When building the project in the IDE it is no problem. Do I have to explicitly include the subfolder? I'm building the projects from the terminal with distcc, may this cause the problem somehow?

Needs some compiler options, which the IDE reads from settings.json and passes to make. See the runme.sh file for the command line version of that

14 days later

Alright, I have to check this out later. But this makes it clear! Thanks!