Io
Types
pinState
pinState
Constructors
Functions
high
Type Signature
(||)() -> pinState
low
Type Signature
(||)() -> pinState
Types
mode
mode
Constructors
Functions
input
Type Signature
(||)() -> mode
output
Type Signature
(||)() -> mode
inputPullup
Type Signature
(||)() -> mode
toggle

Given a high value, returns a low value. Given a low value, returns a high value.

Type Signature
(||)(pinState) -> pinState
Parameters
p : pinState

The pinState which you would like to find the opposite value of.

Returns

The opposite pinState.

printString

Writes a string to the serial output.

Type Signature
(||)(string) -> unit
Parameters
str : string

The string to write

Returns

unit

printCharList

Writes a character list to the serial output.

Type Signature
<;n>(||)(list<uint8;n>) -> unit
Parameters
cl : list<uint8;n>

The character list to print

Returns

unit

printFloat

Writes a float to the serial output.

Type Signature
(||)(float) -> unit
Parameters
f : float

The number to write

Returns

unit

printInt

Writes an integer to the serial output.

Type Signature
(||)(int32) -> unit
Parameters
n : int32

The number to write

Returns

unit

Types
base
base
Constructors
Functions
binary
Type Signature
(||)() -> base
octal
Type Signature
(||)() -> base
decimal
Type Signature
(||)() -> base
hexadecimal
Type Signature
(||)() -> base
baseToInt

Converts a base to the numerical integer base it represents.

Type Signature
<'t>(||)(base) -> 't where 't : int
Parameters
b : base

The base value

Returns 2 in the case of binary, 8 for octal, 10 for decimal and 16 for hexadecimal

printIntBase

Writes an integer in the given base to the serial output.

Type Signature
(||)(int32, base) -> unit
Parameters
n : int32

The number to write

b : base

The base to use

Returns

unit

printFloatPlaces

Writes a float with the given number of decimal places to the serial output.

Type Signature
(||)(float, int32) -> unit
Parameters
f : float

The number to write

numPlaces : int32

The number of decimal places to use

Returns

unit

beginSerial

Sets up serial ouput

Type Signature
(||)(uint32) -> unit
Parameters
speed : uint32

Sets the data rate in bits per second (baud) for serial data transmission.

Returns

Unit

See also: https://​www​.arduino​.cc​/en​/Serial​/Begin

pinStateToInt

Converts a pinState to an integer representation.

Type Signature
(||)(pinState) -> uint8
Parameters
value : pinState

The pinState to Converts

Returns

0 for low and 1 for high

intToPinState

Converts an integer to a pinState representation.

Type Signature
(||)(uint8) -> pinState
Parameters
value : uint8

The integer value to convert

Returns

low for 0 and high for anything else

digWrite

Writes a value directly to a pin.

Type Signature
(||)(uint16, pinState) -> unit
Parameters
pin : uint16

The pin to write to.

value : pinState

The state the pin should be in.

Returns

Unit

See also: digOut

digRead

Reads a value direction from a pin.

Type Signature
(||)(uint16) -> pinState
Parameters
pin : uint16

The pin to read from.

Returns

The value of the pin.

See also: digIn

digIn

Creates an input signal given some pin identifier.

Type Signature
(||)(uint16) -> sig<pinState>
Parameters
pin : uint16

The pin to read from

Returns

A signal holding the state of the pin.

See also: digRead

digOut

Takes in an input signal and writes the value contained in the signal to the given pin.

Type Signature
(||)(uint16, sig<pinState>) -> unit
Parameters
pin : uint16

The pin to write to

sig : sig<pinState>

The signal to output to the pin

Returns

Unit

See also: digWrite

anaRead

Reads a value directly from an analog pin.

Type Signature
(||)(uint16) -> uint16
Parameters
pin : uint16

The pin to read from

Returns

A value ranging from 0 to 1023.

See also: anaIn https://​www​.arduino​.cc​/en​/Reference​/AnalogRead

anaWrite

Writes an analog (PWM) value directly to an analog pin.

Type Signature
(||)(uint16, uint8) -> unit
Parameters
pin : uint16

The pin to write to

value: uint8

The analog value to write to the pin. This number ranges from 0 (always off) to 255 (always on)

See also: anaOut https://​www​.arduino​.cc​/en​/Reference​/AnalogWrite

anaIn

Creates an analog input signal given some pin identifier.

Type Signature
(||)(uint16) -> sig<uint16>
Parameters
pin : uint16

The pin to read from

See also: anaRead

anaOut

Takes in an analog input signal and writes the value contained in the signal to the given analog pin.

Type Signature
(||)(uint16, sig<uint8>) -> unit
Parameters
pin : uint16

The pin to write to

sig : sig<uint8>

The analog signal to output to a pin

Returns

Unit

pinModeToInt

Converts a pinMode to an integer representation.

Type Signature
(||)(mode) -> uint8
Parameters
m : mode

The mode to convert

Returns

0 for input, 1 for output and 2 for inputPullup

intToPinMode

Converts an integer representation to a pinMode

Type Signature
(||)(uint8) -> mode
Parameters
m : uint8 - The mode to convert
Returns

input for 0, output for 1 and inputPullup for 2

setPinMode

Sets the mode of a specified pin

Type Signature
(||)(uint16, mode) -> unit
Returns

Unit

risingEdge

Takes in a signal and a previous state and outputs a new signal that fires when the input signal transitions from low to high.

Type Signature
(||)(sig<pinState>, pinState ref) -> sig<unit>
Parameters
sig : sig<pinState>

The digital input signal

prevState : pinState ref

Holds the previous state of the signal

Returns

A signal of type unit. The signal fires unit on a rising edge, otherwise it does not fire.

fallingEdge

Takes in a signal and a previous state and outputs a new signal that fires when the input signal transitions from high to low.

Type Signature
(||)(sig<pinState>, pinState ref) -> sig<unit>
Parameters
sig : sig<pinState>

The digital input signal

prevState : pinState ref

Holds the previous state of the signal

Returns

A signal of type unit. The signal fires unit on a falling edge, otherwise it does not fire.

edge

Takes in a signal and a previous state and outputs a new signal that fires when the input transitions from high to low or low to high

Type Signature
(||)(sig<pinState>, pinState ref) -> sig<pinState>
Parameters
sig : sig<pinState>

The digital input signal

prevState : pinState ref

Holds the previous state of the signal

Returns

A signal that outputs high on a rising edge and low on a falling edge.