标签:利用 init attach ram ack pwm include set 地址
TimerOne地址:
https://code.google.com/archive/p/arduino-timerone/downloads
ex:
#include "TimerOne.h"
void setup()
{
pinMode(10, OUTPUT);
Timer1.initialize(500000); // initialize timer1, and set a 1/2 second period
Timer1.pwm(9, 512); // setup pwm on pin 9, 50% duty cycle
Timer1.attachInterrupt(callback); // attaches callback() as a timer overflow interrupt
}
void callback()
{
digitalWrite(10, digitalRead(10) ^ 1);
}
void loop()
{
// your program here...
}
*/
Arduino利用TimerOne库产生固定频率和占空比的方波
标签:利用 init attach ram ack pwm include set 地址
原文地址:http://www.cnblogs.com/myohao/p/6155419.html