→ god145145: 1."按下"、"放開" 2.b1是把開關腳讀值暫時存下來 04/05 11:04
我再附上fig.2,
模擬結果是:我每執行完一次的 "按下"&"放開" ,結果不是 留在 0 就是 1,
可是我以為 都是0 ○也!
因為loop 的最後一行不是for reset到0 嗎?
※ 編輯: howisfashion (49.216.225.148 臺灣), 04/05/2024 16:00:12
→ god145145: 只有放開的時候才會執行下面那段 04/05 18:13
→ god145145: 先跳到通訊 學用Serial.println把你想看的變數輸出 04/05 18:14
懂了!!
那麼在電腦上,怎麼用滑鼠代替 按下(長按)/放開?!
※ 編輯: howisfashion (49.216.225.148 臺灣), 04/05/2024 18:43:57
※ 編輯: howisfashion (49.216.225.148 臺灣), 04/05/2024 18:47:00
我把 Serial.println(lastState); 打在void setup() 裡頭,不知道這樣做對嗎?!
我是在TinkerCAD底下作模擬的,要去哪裏看結果呢?!
※ 編輯: howisfashion (49.216.225.148 臺灣), 04/05/2024 19:02:43
→ god145145: 在TinkerCAD 搜尋 Using the Serial Monitor 04/05 19:25
我加了fig.3,請問是圖中右下方的Serial Monitor 嗎?
可是它空白的○也?!
※ 編輯: howisfashion (49.216.225.148 臺灣), 04/05/2024 21:35:50
→ Archer55b6: 你要寫code讓arduino傳東西到serial port,電腦端收 04/05 21:41
→ Archer55b6: 到才會印出來 04/05 21:41
寫code?! 我有丫,就寫了一行 Serial.println(lastState); 在void setup()裡,
不對嗎?!
※ 編輯: howisfashion (49.216.225.148 臺灣), 04/05/2024 21:55:38
→ tomsawyer: 要先一次性begin()才能印東西到console 04/06 11:15
感謝大家,不過這些好像是CH.5以後的問題;
CH.4快完成了,等等我再來開車!!
謝謝!
※ 編輯: howisfashion (49.216.225.148 臺灣), 04/06/2024 20:45:28
不知道t 大所謂的一次性begin() 是什麼意思?!
不過請看我的fig.4,我只能在TinkerCAD的Serial Monitor上看到那些?!
※ 編輯: howisfashion (49.216.225.148 臺灣), 04/07/2024 17:32:22
→ god145145: ,SERIAL 刪掉 你是用哪本書? 04/07 20:56
https://imgur.com/a/qkQqQMe
※ 編輯: howisfashion (101.10.49.146 臺灣), 04/08/2024 07:06:30