示例#1
0
int main()
{
	struct inotify_event iev;
	int inotify_fd;

	inotify_fd = inotify_init();
	if(inotify_fd == -1) {
		perror("inotify_init");
		return EXIT_FAILURE;
	}

	if(inotify_add_watch(inotify_fd, "/watch", IN_CLOSE_NOWRITE) == -1) {
		perror("inotify_add_watch");
		return EXIT_FAILURE;
	}

	do {
		if(read(inotify_fd, &iev, sizeof(struct inotify_event)) <= 0) {
			perror("read");
			break; /* Sin duda esto no sucedera */
		}
		usleep(500000);
		stop_servo("/tmp/v4/left/run");
		stop_servo("/tmp/v4/right/run");
	} while(1);

	return EXIT_FAILURE;
}
示例#2
0
void etch_init() {
    stop_servo(ETCH_VERTICAL);
    stop_servo(ETCH_HORIZ);
}