I spent quite some time, but I wasn't able to find the answer (and found other interesting sources like changing pwm frequency 1 and changing the frequency 2), and I lack the equipment to find out by myself.
I'm on a Raspberry Model B, using NodeJS along with wiring-pi. To initialize and setup PWM on Pin12 = WiringPiPin1 = GPIO1 = BCM18 = the hardware-PWM-enabled-PIN I'm using the following code:
var wpi = require('wiring-pi');
var wiringPiMotorPin = 1;
wpi.wiringPiSetup();
wpi.pinMode(wiringPiMotorPin, wpi.modes.PWM_OUTPUT);
var motorState = 0;
// target state ranges from 0-1024
var setMotor = function(targetState) {
if (motorState != targetState) {
wpi.pwmWrite(wiringPiMotorPin, targetState);
motorState = targetState;
}
};
So I didn't change anything to the PWM-divider using e.g. pwmSetClock
. What is 'default' settings for duty cycle/frequency of the hardware-PWM? I need to know, because I need to setup a RC-lowpass-filter (PWM-frequency is audible from the connected motor).
Thank you very much in advance.