farmbot v6.0.0 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"}
Parses farmbot_arduino_firmware params. If we want the name of param “0”\n Example:
iex> Gcode.parse_param("0")
:param_version
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_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_param(param)
View Source
parse_param(binary | integer) :: atom | nil
parse_param(atom) :: integer | nil
Parses farmbot_arduino_firmware params. If we want the name of param “0”\n Example:
iex> Gcode.parse_param("0")
:param_version
Example:
iex> Gcode.parse_param(0)
:param_version
If we want the integer of param :param_version\n Example:
iex> Gcode.parse_param(:param_version)
0
Example:
iex> Gcode.parse_param("param_version")
0
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"}