You are reading a single comment by @kri100s and its replies. Click here to read the full conversation.
  • I am wondering what is the best approach for updating a motor PWM over web bluetooth from the joystick or other device. In the past pre-espruino implementations I would just send data frame and commands would be just fired periodically (or on event) on the control board. With espruino you can send a whole command over BLE like:

    mot.dcMotorControl(mot.dir.FWD,0.05);
    

    I have a feeling if I do that with too hight update rate by moving a knob in my web joystick that would cause problems. It would be fine for toggling lights but not for continuously updated value. Do I just have to setInterval on the controller side or I could listen for an event from BLE? I think listening for an event would be best. Maybe with some mechanism for discarding uncaught events so they dont queue. Is there a best practice here?

About

Avatar for kri100s @kri100s started