IO

Default behavior

obnizOS takes control of all IO. In particular, it resets the IO in the following cases

  • After starting obnizOS
  • When offline
  • When the client is disconnected (when reset_obniz_on_ws_disconnection: false is not set)

If you want to use IO from the plugin, you need to tell obnizOS in advance that you want to remove this IO from the management.
The following functions can be used to manage the IO to be used.

Retain by Plugin Software

Remove the IO from the management of obnizOS and use it exclusively.

obniz.pinReserve(io)

Release from Plugin Software

Return to obnizOS management.

obniz.pinFree(io)

Automatic Retain

Calling the following function will automatically occupy the IO. However, it is better to call pinReserve() in advance to resolve conflicts with obnizOS.

  • pinMode
  • wire.begin
  • analogRead

関連の質問