#include <stdio.h>#include <string.h>#include <stdlib.h>#include "dcmotor2.h"Include dependency graph for dcmotor2test.c:

Go to the source code of this file.
Functions | |
| int | main (int argc, const char **argv) |
Variables | |
| DC_MOTOR_STRUCT | dcm |
| int | skip_cycles = 0 |
| double | cycle_time = 0.1 |
|
||||||||||||
|
Definition at line 16 of file dcmotor2test.c. 00017 {
00018 int i = 0;
00019 if(argc > 1)
00020 {
00021 cycle_time=strtod(argv[1],0);
00022 }
00023 if(argc > 2)
00024 {
00025 skip_cycles=strtol(argv[2],0,0);
00026 if(skip_cycles > 0)
00027 {
00028 cycle_time = cycle_time/(skip_cycles+1);
00029 }
00030 }
00031 dcmotorInit(&dcm);
00032 dcmotorSetCycleTime(&dcm, cycle_time);
00033 dcmotorIniLoad(&dcm,"sim.ini","AXIS_0");
00034 dcmotorSetCycleTime(&dcm, cycle_time);
00035 dcmotorSetParameters(&dcm, dcm);
00036
00037 while(1)
00038 {
00039 for(i = 0; i < skip_cycles; i++)
00040 {
00041 dcmotorRunCycle(&dcm,1.0);
00042 }
00043 printf("%f\n",dcmotorRunCycle(&dcm,1.0));
00044 }
00045
00046 }
|
|
|
Definition at line 14 of file dcmotor2test.c. |
|
|
Definition at line 12 of file dcmotor2test.c. |
|
|
Definition at line 13 of file dcmotor2test.c. |
1.2.11.1 written by Dimitri van Heesch,
© 1997-2001