User manual

20Page
Velleman Projects
3.13
SetPWM
Syntax
void SetPWM(int CardAddress, int Channel, int Data, int Freq);
Parameters
CardAddress: The address of previously opened card.
Channel: The PWM output channel 1 or 2.
Data: Value between 0 and 255 which is to be sent to the PWM output of the card. The duty cycle of
the PWM output corresponds to the data value: 0 = 0%, 255 = 100% duty cycle.
Freq: The PWM frequency:
1: 2929.68 Hz
2: 11718.75 Hz
3: 46875 Hz
Example
SetPWM(CardAddress, 1, 128, 3);
// The duty cycle of the PWM output #1 is set to 50%, frequency 46875 Hz