hustwhzl 发表于 2014-10-16 21:02 
谢谢先,不过我是复制的您那段程序啊,还是报错呢……就是提示是blink was not declared in this scope。
... - int pin = 13;
- volatile int state = LOW;
- void blink()
- {
- //中断函数中写你想做的操作,中断函数中的程序越简单越好。
- state = !state;
- }
- void setup()
- {
- pinMode(pin, OUTPUT);
- attachInterrupt(0, blink, CHANGE);
- }
- void loop()
- {
- digitalWrite(pin, state);
- }
复制代码
你的IDE的版本? |