• That's fantastic - thanks for posting it up! Would it be ok if you contributed your Servo block back? I imagine it'd be really handy!

  • I would love to. It isn't much more then mapping the value from degrees to duty-cycle and adding the { freq: 50 } to analogWrite(...).
    One problem with pushing this upstream is that different kinds of servos have different mappings from pulse width to angle. I could expose the raw pulse width as an argument for the block, but that would make the block less friendly / useful.
    Any suggestions on how to make this configurable without too much hassle for the block user? Perhaps a global servoConfig block that much precede and usage of servoWrite(...)? But then, is it too much to assume that a given program will only use one servo type?
    For the purpose of my son's usage, I simply hard-coded the mapping of the specific servo that I gave him, and problem solved...

About

Avatar for Gordon @Gordon started