}
break;
+ case 'p':
+ if(!argv[++i] || (pin = atoi(argv[i])) < 1 || pin >= 28) {
+ fprintf(stderr, "-p must be followed by a BCM pin number: 1-27\n");
+ return 1;
+ }
+ break;
+
case 'h':
print_usage(argv[0]);
return 0;
printf(" -n: number of pulses to emit (default: 1)\n");
printf(" -f: frequency of pulses in hz (default: 1)\n");
printf(" -d: duty cycle [1, 255] (default: 128)\n");
+ printf(" -p: BCM pin number [1, 27] (default: 24)\n");
printf(" -h: print usage and exit\n");
}