MCPcopy Create free account
hub / github.com/WiringPi/WiringPi / pwmToneWrite

Function pwmToneWrite

wiringPi/wiringPi.c:2501–2513  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2499 */
2500
2501void pwmToneWrite (int pin, int freq)
2502{
2503 setupCheck ("pwmToneWrite") ;
2504
2505 if (freq == 0)
2506 pwmWrite (pin, 0) ; // Off
2507 else
2508 {
2509 int range = 600000 / freq ;
2510 pwmSetRange (range) ;
2511 pwmWrite (pin, freq / 2) ;
2512 }
2513}
2514
2515
2516

Callers 1

doPwmToneFunction · 0.85

Calls 3

setupCheckFunction · 0.85
pwmWriteFunction · 0.85
pwmSetRangeFunction · 0.85

Tested by

no test coverage detected