Menu

readInput

Majenko Technologies

Format

:::C
int readInput(int i);

Description

Get the current value of an input channel. If the channel is set to digital, it will be either 0 or 1; 0 is "pressed", and 1 is "not pressed" (digital inputs are "active low"). If it is set to analog, the value will be between 0 and 4095.

Example

:::C
button_pressed = readInput(2);

Related

Wiki: Firmware Functions

MongoDB Logo MongoDB