舉報
Pins 5 and 6: controlled by Timer 0 in fastPWM mode (cycle length = 256)
Setting Divisor Frequency
0x01 1 62500
0x02 8 7812.5
0x03 64 976.5625
0x04 256 244.140625
0x05 1024 61.03515625
TCCR0B = TCCR0B & 0b11111000 |<setting>;TCCR0B = TCCR0B & 0b11111000 | <setting>;
10kHz 沒有,但有接近的...7.8KHz
可以在void setup() 大括號內加入下面這行
TCCR0B = TCCR0B & 0b11111000 | <0x02>;
再使用pin 5或6 .
Reference:http://playground.arduino.cc/Main/TimerPWMCheatsheet
本版積分規則 發表回復 回帖後跳轉到最後一頁
小黑屋|手機版|Archiver|機器人論壇 from 2005.07
GMT+8, 2025-1-31 14:19 , Processed in 0.195545 second(s), 7 queries , Apc On.
Powered by Discuz! X3.2
© 2001-2013 Comsenz Inc.