Generates a PWM signal on the selected port. Good for simulating an DAC convertor - for instance an LED is a good candidate. :param int power: Number from **0** to **100** that represents the duty cycle as a percentage of the frequency's period. .. tip::
(self, power)
| 469 | return reading_percent |
| 470 | |
| 471 | def write(self, power): |
| 472 | """ |
| 473 | Generates a PWM signal on the selected port. |
| 474 | Good for simulating an DAC convertor - for instance an LED is a good candidate. |
| 475 | |
| 476 | :param int power: Number from **0** to **100** that represents the duty cycle as a percentage of the frequency's period. |
| 477 | |
| 478 | .. tip:: |
| 479 | |
| 480 | If the ``power`` parameter is out of the given range, the most close and valid value will be selected. |
| 481 | |
| 482 | |
| 483 | """ |
| 484 | self.value = power |
| 485 | self.gpg.set_grove_pwm_duty(self.get_pin(), power) |
| 486 | |
| 487 | |
| 488 | def write_freq(self, freq): |