---
tag: m0226
title: Wait for Pin State
brief: Wait for a pin to have a given state
author: thinkyhead

group: control
requires: DIRECT_PIN_CONTROL

codes: [ M226 ]
related: [ M42 ]

parameters:

- tag: P
  optional: false
  description: Pin number
  values:
  - tag: pin
    type: int

- tag: S
  optional: true
  description: State 0 or 1. Default -1 for inverted.
  values:
  - tag: state
    type: int

---

Wait for a pin to have a certain value or state.
