作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个非常基本的示例来说明我正在尝试解决的任务。在 arduino.ino
的主循环中,我使用 sample.h 中的定义调用
。从这里我试图了解如何使用 device.c
中的 sample_run()
函数device.c
中的 GPIO 引脚。可以使用arduino ide来完成吗?我附上了一些我想要做的示例代码。
arduino.ino
#include "sample.h"
#include "esp8266/sample_init.h"
void setup() {
}
void loop() {
sample_run();
}
样本.h
#ifndef SAMPLE_H
#define SAMPLE_H
#ifdef __cplusplus
extern "C" {
#endif
void sample_run(void);
#ifdef __cplusplus
}
#endif
#endif /* SAMPLE_H */
device.c
#include "sample.h"
void sample_run(void)
{
//I would like to turn on/off led here
}
最佳答案
在 device.c 中:#include "Arduino.h"
为什么使用 .c 文件而不是 .cpp?
关于c++ - 如何使用 C 文件中的 esp8266 引脚排列?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50662762/
我是一名优秀的程序员,十分优秀!