188 of 323
ZBasic System Library 178 ZX Microcontroller Family frequency and may be used when the PWM frequency will be changed in the midst of PWM signal generation. Frequency changes are effected by making additional calls to OpenPWM() and the change is synchronized so that it takes effect at the beginning of a cycle. The status parameter, if supplied, receives a value to indicate success or failure of the call. A side effect of calling OpenPWM() is that the timer busy flag for the underlying timer (e.g. Register.Timer1Busy) will be set to True irrespective of its prior state. It is recommended that the initial call to OpenPWM() be preceded by a call to acquire the semaphore for the timer. This will ensure that an existing timer operation will not be disturbed. Example Call OpenPWM(1, 50.0, zxFastPWM) 'prepare for 50Hz Fast PWM using channel 1 Compatibility This subroutine is not available in BasicX compatibility mode. See Also ClosePWM, PWM