Archytax v0.1.1 Archytax.Utilities

A wide variety of functions, from conversions to common patterns.

Summary

Functions

Simple alias for timer sleep. Delay on miliseconds

Simple wrapper for timer.sleep into microseconds

Get true voltage from analog reading. Useful for temperature readings

Get the equivalent value from value in the {to_min, to_max} based on the original value in the range {from_min, from_max}

Functions

delay(miliseconds)

Simple alias for timer sleep. Delay on miliseconds

delay_microseconds(microseconds)

Simple wrapper for timer.sleep into microseconds

getVoltage(analog_value)

Get true voltage from analog reading. Useful for temperature readings.

mapRange(value, from_range, to_range)

Get the equivalent value from value in the {to_min, to_max} based on the original value in the range {from_min, from_max}

You can send the range limits as four arguments Or directly as ranges

Examples

iex> Archytax.Utilities.mapRange(800, 0,1023, 0,255)
199

iex> Archytax.Utilities.mapRange(800, 0..1023, 0..255)
199
mapRange(value, from_min, from_max, to_min, to_max)