MCPcopy Create free account
hub / github.com/DexterInd/GoPiGo3 / write_freq

Method write_freq

Software/Python/easysensors.py:488–508  ·  view source on GitHub ↗

Sets the frequency of the PWM signal. The frequency range goes from 3Hz up to 48000Hz. Default value is set to 24000Hz (24kHz). :param int freq: Frequency of the PWM signal. .. seealso:: Read more about this in :py:meth:`gopigo3.GoPiGo3.set_grove_pwm_

(self, freq)

Source from the content-addressed store, hash-verified

486
487
488 def write_freq(self, freq):
489 """
490 Sets the frequency of the PWM signal.
491
492 The frequency range goes from 3Hz up to 48000Hz. Default value is set to 24000Hz (24kHz).
493
494 :param int freq: Frequency of the PWM signal.
495
496 .. seealso::
497
498 Read more about this in :py:meth:`gopigo3.GoPiGo3.set_grove_pwm_frequency`'s description.
499
500 """
501 self.freq = freq
502 # debug("write_freq: {}".format(self.freq))
503 return_value = self.gpg.set_grove_pwm_frequency(
504 self.get_port_ID(),
505 self.freq)
506 debug ("Analog Write on {} at {}".format(self.get_port_ID(),
507 self.freq))
508 return return_value
509##########################
510
511

Callers 1

soundMethod · 0.80

Calls 3

get_port_IDMethod · 0.80
debugFunction · 0.70

Tested by

no test coverage detected