amowry / WARBL2

WARBL2 Code and design files
https://warbl.xyz/index.html
GNU General Public License v3.0
5 stars 2 forks source link

A raw mode #2

Closed ithinu closed 6 days ago

ithinu commented 1 month ago

I would need/like to implement a raw mode. When on, instead of the MIDI note/pitch bend messages, WARBL would send only updates about any pressure/hole/button/IMU sensor values that changed. Looks like something easy to do and taking little space.

In the raw mode, only the functions getSensors(), readMIDI(), readIMU(), blink(), pulse(), calibrate(), checkButtons(), sendToConfig(), manageBatter(), watchdogReset() would be called inside loop(). The method handleControlChange() would need to support two more MIDI events: raw mode on/off. Additional functions would need to be implemented which would send respective update events as MIDI messages. One such function per each sensor read frequency.

Did I miss something in the implementation sketch above?

amowry commented 1 month ago

You could definitely do this but my only concern would be that it might be a lot of data to send if you want to send it at a reasonably high rate and several sensors are changing at once. It might be fine with USB but I suspect you may run into issues with BLE bandwidth.

You'd also want to keep the delay() in the loop because otherwise the NRF will try to poll the ATmega too frequently (before it has had time to read the sensors and go to sleep).