1 /* Humusoft data acquisition library.
3 * Example that shows using multiphase PWM output channel.
4 * This example works on MF625 only!
7 /* Copyright 2002-2007 Humusoft s.r.o. */
14 int main(int argc, char* argv[])
17 unsigned phases[] = { 0, 1, 2, 3, 4, 5};
18 double duties[] = {0.2,0.4,0.5,0.6,0.7,0.8};
20 double d[]= {1,1.05,1.1,1,1,1};
22 /* open a handle to the first MF625 device in the system */
23 h = HudaqOpenDevice("MF625", 1, 0);
26 printf("\nData acquisition device MF625 not found.\n");
30 /* set the first PWM channel to frequency 2.5kHz with duty cycles 0.1 0.5 0.9 */
31 HudaqPWMWriteMultiphase(h, 0, 6, phases, 2500, duties);
33 //HudaqSetParameter(h, 0, HudaqPwmCLOCKSOURCE, HudaqCtrCLOCKINFALLING);
34 //HudaqSetParameter(h, 0, HudaqPwmFILTER, 0);
36 HudaqPWMWriteMultiphase(h, 0, 6, phases, 12000000 /*0.005*/, d);
38 /* close the device handle */