farmbot v6.0.1-alpha Farmbot.Firmware.Gcode.Parser View Source

Parses farmbot_arduino_firmware G-Codes.

Link to this section Summary

Functions

Parses End Stops. I don’t think we actually use these yet. Example:

iex> Gcode.parse_end_stops("XA1 XB1 YA0 YB1 ZA0 ZB1 Q123")
{:report_end_stops, "1", "1", "0", "1", "0", "1", "123"}

common function for report_(something)_value from gcode. Example:

iex> Gcode.parse_pvq("P20 V100", :report_parameter_value)
{:report_parameter_value, "20" ,"100", "0"}

Link to this section Types

Link to this type reporter() View Source
reporter ::
  :report_current_position |
  :report_encoder_position_scaled |
  :report_encoder_position_raw

Link to this section Functions

Link to this function parse_code(code) View Source
parse_code(binary) :: {binary, tuple}
Link to this function parse_end_stops(arg) View Source
parse_end_stops(binary) :: {:report_end_stops, binary, binary, binary, binary, binary, binary, binary}

Parses End Stops. I don’t think we actually use these yet. Example:

iex> Gcode.parse_end_stops("XA1 XB1 YA0 YB1 ZA0 ZB1 Q123")
{:report_end_stops, "1", "1", "0", "1", "0", "1", "123"}
Link to this function parse_pvq(params, human_readable_param_name) View Source
parse_pvq(binary, :report_parameter_value) :: {:report_parameter_value, atom, integer, String.t}

common function for report_(something)_value from gcode. Example:

iex> Gcode.parse_pvq("P20 V100", :report_parameter_value)
{:report_parameter_value, "20" ,"100", "0"}

Example:

iex> Gcode.parse_pvq("P20 V100 Q12", :report_parameter_value)
{:report_parameter_value, "20" ,"100", "12"}