9 Star 30 Fork 9

空想实验室技术(深圳)有限公司/nulllab_arduino

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
FlashLed.ino 534 Bytes
一键复制 编辑 原始数据 按行查看 历史
nulllab 提交于 2021-11-05 10:23 +08:00 . Add timer function
#include <MsTimer3.h>
// Switch on LED on and off each half second
#if ARDUINO >= 100
const int led_pin = LED_BUILTIN; // 1.0 built in LED pin var
#else
const int led_pin = 13; // default to pin 13
#endif
void flash()
{
static boolean output = HIGH;
// Serial.println("flash led");
digitalWrite(led_pin, output);
output = !output;
}
void setup()
{
Serial.begin(9600);
pinMode(led_pin, OUTPUT);
MsTimer3::set(1000, flash); // 500ms period
MsTimer3::start();
Serial.println("setup");
}
void loop()
{
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/nulllab/nulllab_arduino.git
git@gitee.com:nulllab/nulllab_arduino.git
nulllab
nulllab_arduino
nulllab_arduino
master

搜索帮助