Replies: 2 comments 3 replies
-
|
Hi - this looks like a great idea! You could actually add this as something you could flash with https://espruino.com/apps to make it even easier?
When the Puck is idle it'll go to a low power connection interval (200ms) but when transmitting it'll go to the highest (7.5ms) - NRF.setConnectionInterval will force that but it's probably ok as-is. But if you're sending too much information the HID command will fail. I see you're trapping errors from But also I see you're using console.log, and this could be trying to push the data you're logging over bluetooth as well? So that would slow things down and I'd maybe add a Also I see I think you're polling at 50ms, but the AHRS code is only updating at 12.5hz (~80ms?) - it might be better if the AHRS code had a callback that called your main code, rather than you querying AHRS.getOrientationDegree?
You know if you're idle as you check x/y: https://github.com/inclusion-international/Wheely-Joystick-Mouse/blob/main/src/Espruino/main.js#L293 So maybe have a counter that you increment when x and y are 0, then after it gets to some value you turn the accelerometer off. The Puck has a mode where it can put the accelerometer into a low power mode and call you when it moves (https://www.espruino.com/Puck.js#accelerometer-gyro), or you could just have it wake up with a button press? |
Beta Was this translation helpful? Give feedback.
-
|
Some other things: Is it possible to empty the HID-buffer in the case of bluetooth connection? |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am working on the project Wheely-Joystick-Mouse for wheelchair users, so that they would be able to use the primary wheelchair joystick also as a bluetooth mouse for their computer or Smartphone.
I have implemented support for mouse movement dependig on the tilt level of the puck.js using the built-in IMU.
You can also configure various button press patterns via web UI to trigger mouse button actions.
The mouse movement works pretty well, but sometimes there are annoying interruptions in mouse movement.
It looks like some HID reports were lost.
What could be the problem? Should I got down with the frequency of sending HID reports? How is the NRF.sendInterval parameter related?
It's also important that the algorithm works pretty energyefficient, so after some time of inactivity the puck.js should go idle.
So all hints in this regard are pretty welcome!!
Follow the instructions to flash and configure the puck.s as a mouse joystick:
Wheely-Joystick-Mouse Web-UI
How could I improve the firmware?
Beta Was this translation helpful? Give feedback.
All reactions