Analog I/O

Analog I/O

Methods


analog_read(pin)

Parameters:
Name Type Description
pin

pin to read the value of

Code Equivalent:
analogRead(pin)

analog_reference(type)


Sets the reference voltage used for analog input.

Check out the third party documentation for a more in depth explanation.

Parameters:
Name Type Description
type

which setting to set the reference voltage to.

Code Equivalent:
analogReference(type);

analog_write(value, pin)

Parameters:
Name Type Description
value

value to write to the pin

pin

pin to write to

Code Equivalent:
analogWrite(pin, value);

tone_pin_freq_duration(frequency, pin, duration)


Plays the given frequency on the given pin for the specified amount of time.

Check out the third party documentation for a more in depth explanation.

Parameters:
Name Type Description
frequency

frequency to play

pin

pin to play the frequency on

duration

how long to play the tone for

Code Equivalent:
tone(pin, frequency, duration);