R/blgcode.R

Defines functions blgcode

Documented in blgcode

#' @title blgcode
#' @description Generate GCODE that will test the overall flatness of your print bed.
#' I can't get roxygen to stop doublecommenting this
#' @name blgcode
#' @param x The size of your X axis.
#' @param y The size of your Y axis.
#' @examples 
#' blgcode(150,150)
#' @export

blgcode <- function(x,y)
{
  a = x
  b = y
  x = x/ 25
  y = y / 25
  f = a - 25 
  d = b - 25 

  sink("GCODE.txt")
  cat("Your bed is ", a, "mm x", b, "mm. Run this GCODE to get measurements on how flat your printbed is.\nYou will have to copy the results from your printer's output and then organize the data into a matrix in order to make a surface graph. \n\nG28\n")
  
  for(i in 0:(x))
  {
      for(u in 0:(y))
      {
        cat("G0 X",i * 25," Y",u*25, "\nG30\n", sep="")
      }#for u
  }#for i
}#function
ryanscharf/printtools3d documentation built on May 28, 2019, 10:45 a.m.