summaryrefslogtreecommitdiff
path: root/nc_files/M102.c
blob: 7b38957775c658ca0a4844d7a15828bd90e4de69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <stdio.h>

/*
  Compile this with "gcc M102.c -o M102" to build an M102 executable
  program in the emc/programs/ directory. M102 in your G code program
  will execute this code, passing the P and Q variables as command
  line arguments.
 */

int main(int argc, char *argv[])
{
  double p = 0.0, q = 0.0;

  /* process the P and Q command line args we will be given */
  if (argc > 1) {
    sscanf(argv[1], "%lf", &p);
  }
  if (argc > 2) {
    sscanf(argv[2], "%lf", &q);
  }

  /* put your code here */

  printf("M102 P%f Q%f: put your code here\n", p, q);

  return 0;
}