int main(int argc, char **argv) { if (argc < 2) { fprintf(stderr, "usage: %s CURR [PARAMS]\n", argv[0]); return -1; } float target_value = atof(argv[1]); epos_node_t node; epos_current_t curr; epos_init_arg(&node, argc, argv, 0); signal(SIGINT, epos_signaled); if (epos_open(&node)) return -1; epos_current_init(&curr, target_value); if (!epos_current_start(&node, &curr)) { while (!quit) { fprintf(stdout, "\rEPOS current: %8.4f A", epos_get_current(&node)); fflush(stdout); } fprintf(stdout, "\n"); epos_current_stop(&node); } epos_close(&node); epos_destroy(&node); return 0; }
void era_motors_destroy(era_motors_p motors) { int i; epos_node_p node_a = (epos_node_p)motors; for (i = 0; i < sizeof(era_motors_t)/sizeof(epos_node_t); ++i) epos_destroy(&node_a[i]); }
int main(int argc, char **argv) { epos_node_t node; epos_init_arg(&node, argc, argv, 0); if (epos_open(&node)) return -1; printf("EPOS hardware version: 0x%04X (%s)\n", node.dev.hardware_version, epos_device_names[node.dev.type]); printf("EPOS software version: 0x%04X\n", node.dev.software_version); epos_close(&node); epos_destroy(&node); return 0; }
int main(int argc, char **argv) { epos_node_t node; epos_init_arg(&node, argc, argv, 0); signal(SIGINT, epos_signaled); if (epos_open(&node)) return -1; while (!quit) { fprintf(stdout, "\rEPOS sensor position: %10d steps", epos_sensor_get_position(&node.sensor)); fflush(stdout); } fprintf(stdout, "\n"); epos_close(&node); epos_destroy(&node); return 0; }