Thus if set-up like that your PWM output frequency will be 1/1024 th of your PWM clock frequency.nickon314 wrote:I'm trying to port some Arduino code over to the Pi. It's an InfraRed transmitter, sending NEC format IR codes.
The PWM needs to be 38KHz.
And, the 1 and 0 are transmitted by varying the length of time that the PWM is turned on ( I think ).
So, first, I guess I need to ensure that 38KHz is actually coming out.
Then, I need to check the timing of on/off .
If I understand he wiringPi example code, it sets a range of 0 to 1023. So, If I set the duty cycle to 512 then that's 50%, which should produce a square wave with equal periods of on and off.
Users browsing this forum: Exabot [Bot], Schakal_No1 and 11 guests