But yes, it's always running - but it enters sleep modes automatically when it can. As a result if you're just sitting there waiting for a button press it's extremely efficient.
You probably want it to stay connected, but as long as you're using an up to date firmware on it, it'll enter a low power mode when it's connected but not transmitting anything, so the battery life will still be pretty decent (hopefully 1 yr).
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
But yes, it's always running - but it enters sleep modes automatically when it can. As a result if you're just sitting there waiting for a button press it's extremely efficient.
You probably want it to stay connected, but as long as you're using an up to date firmware on it, it'll enter a low power mode when it's connected but not transmitting anything, so the battery life will still be pretty decent (hopefully 1 yr).
Also... this code might already do exactly what you want http://www.espruino.com/BLE+Music+Control