firmware icon indicating copy to clipboard operation
firmware copied to clipboard

Expose IMU/Gyroscope sensor data directly to BruceScript (JS API)

Open Dime-gluchov opened this issue 6 months ago • 1 comments

Hello Bruce Team,Thank you for this amazing firmware and the awesome BruceScript interpreter! It is a fantastic tool for custom scripts.I would like to request a new feature: giving JavaScript developers direct access to the built-in IMU/Gyroscope (accelerometer) sensor data within the BruceScript environment.Currently, when we write and launch a custom JS script on devices like the M5Stick S3, we are strictly limited to physical buttons (keyboard.getPrevPress, etc.). However, many interactive scripts and mini-games require more dynamic controls that buttons alone cannot provide.It would be amazing to have an API module (e.g., var imu = require('imu');) that returns the current tilt/acceleration values (X, Y, and Z axes) in real-time while the script is running.Having this sensor data exposed to JavaScript code would allow developers to:Handle device tilting to control elements, characters, or cursors inside their custom scripts.Build creative motion-activated triggers or custom input methods within the script runtime.Make JS-based applications on Bruce feel much more advanced and responsive.Since the hardware already has the sensor, exposing its readings to the JS runtime would be an incredible upgrade for everyone writing custom scripts.Thank you for your time and consideration!

Dime-gluchov avatar May 24 '26 21:05 Dime-gluchov

The "BAD BLE" module would also be useful in the Java script interpreter.

DESVOR8 avatar May 26 '26 07:05 DESVOR8