2017年4月16日 星期日

學習記錄:Marlin在Arduino中如何實現用C語言呢?

一般而言,在Arduino中大多都是以INO這檔案為主
以下:
Blink.ino
Config.h
Marlin.h
main.cpp

Blink.ino內容:
==================================================================

==================================================================

Config.h
==================================================================
#ifndef CONFIG_H
#define CONFIG_H

#include "Arduino.h"   //似乎這個就是個關鍵

#endif
==================================================================

Marlin.h    (這只是用來測試「間接」而已)
==================================================================
#ifndef MARLIN_H
#define MARLIN_H
#include "Config.h"
#endif
==================================================================

main.cpp
==================================================================
#include "Marlin.h" //這裡其實可以包含Config.h的,多用個Marlin.h是為了表示可間接

void setup(){
}
void loop(){
}
==================================================================

沒有留言:

張貼留言