-2
這個程序調節電動機告訴它3秒前輸出120伏,3秒後輸出255伏..不知道爲什麼這不是編譯。我的arduino代碼有什麼問題?我得到一個失敗,編譯錯誤,不知道爲什麼
int motorPin = 9;
void setup() {
// put your setup code here, to run once:
pinMode(9,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
#include <time.h>
if (int tm_sec<int tm_3sec);
analogWrite(9,120);
else (int tm_sec>int tm_3sec);
analogWrite(9,255);
您應該將'include'語句移出'loop()'函數。 'if's後面還要去掉分號。 Aslo,聲明'tm_sec' ....很多問題。 –
#include在循環()中不合適。 – JimmyB
請確實包含您的編譯器輸出 –