Arduino版本arduino-1.6.7,测试型号Arduino Nano,测试工具Saleae Logic 1.1.15
测试代码:
void setup() { pinMode(13, OUTPUT); } void loop() { digitalWrite(13, HIGH); digitalWrite(13, LOW); digitalWrite(13, HIGH); digitalWrite(13, LOW); }
测试结果:
双路测试:
尝试寄存器操作:
void setup() { pinMode(13, OUTPUT); //pinMode(11, OUTPUT); DDRB |= (1<<PB3); } void loop() { digitalWrite(13, HIGH); digitalWrite(13, LOW); digitalWrite(13, HIGH); digitalWrite(13, LOW); //PB3 digitalWrite(11, HIGH); digitalWrite(11, LOW); PORTB |= (1<<PB3); PORTB &= ~(1<<PB3); PORTB |= (1<<PB3); PORTB &= ~(1<<PB3); }
结果: