Pin mode ⏪
This action changes the mode of a digital I/O pin to either INPUT
or OUTPUT
.
Emulator | Arduino | ESP IDF | Zephyr | |
---|---|---|---|---|
Support | ⏪ | ✅ | ✅ | ⏪ |
Interface
wasm
(func chip_pin_mode (param $pin i32) (param $mode i32))
ts
function pinMode(pin: i32, mode: PinMode): void
rust
fn pin_mode(pin: u32, mode: PinMode)
Parameters
WebAssembly
- pin: must be a valid I/O pin number of the microcontroller
- mode: either 0 (input) or 2 (output)
AssemblyScript
ts
enum PinMode {
/** Input mode for digital pins */
INPUT = 0x0,
/** Output mode for digital pins */
OUTPUT = 0x2,
}
Rust
rust
enum PinMode {
/** Input mode for digital pins */
INPUT = 0x0,
/** Output mode for digital pins */
OUTPUT = 0x2,
}