If you are using Mix as you Elixir build tool (which you really should), add the driver_elixir.ex file to the /lib
folder in your Mix folder. When running iex -S mix
from your Mix folder the driver should be available as a module named Driver
.
iex(1)> {:ok, driver_pid} = Driver.start_link([])
{:ok, #PID<x.xxx.x>}
iex(1)> {:ok, driver_pid} = Driver.start_link([])
{:ok, #PID<x.xxx.x>}
iex(2)> Driver.set_motor_direction(:down)
iex(1)> {:ok, driver_pid} = Driver.start_link([])
{:ok, #PID<x.xxx.x>}
iex(2)> Driver.set_floor_indicator(2)