Skip to content

IOpin service documentation #13

@LoFiRobot

Description

@LoFiRobot

Hey Rob,

Thanks for your great library! It really simplifies talking to micro:bit over web-bluetooth.

I cannot find any documentation about accessing IOpin service.

After diggin into console I managed to work out PWM control to operate a servo motor.

      let pwm = {
        pin: pin, // 0,1,2
        value: val, // 50-250
        period: 10000 // 10000 microsecconds = 10 millisecconds
      }
      services.ioPinService.setPwmControl(pwm);

....

Still I am confused how to take analog readings from IO pins. Setting AD and IO configuration with bitmasks is a riddle to me. Could you please provide any code sample how to set:
setIoConfiguration and getAdConfiguration to configure P0 , P1, and P2 for analog readings??

Thank you in advance.

Maciej

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions