ht_pwm_width()


调整指定PWM模式的HT(Hardware Timer)的占空比

Description

void ht_pwm_width(int $ht_id, int $width, int $period)

Parameters

Return Value

none

Example

<?php
include "/lib/sd_340.php";
ht_pwm_setup(0, 1, 100);      // Changing HT0 as period 100us with 1% duty PWM
for($i = 0; $i < 99; $i++)
{
  ht_pwm_width(0, 1+$i, 100); // increasing duty cycle by 1%
}
?>

See also