ãä¸å¯§ã«è§£èª¬ãM5Stack éçºç°å¢æ§ç¯ ãArduino IDE ãã VSCodeã®Arduinoæ¡å¼µæ©è½ å°å ¥ ã¾ã§ã
ãharattamouseã®å°é¨å±ãã¯ç§»è»¢ãã¾ãããæ°ãã¼ã¸ã¯ ãHaratta-Tech-Labãã§ãã
Â
Â
Â
ä»å㯠M5Stackã®éçºç°å¢ã®å°å
¥ããã¥ã¼ããªã¢ã«å½¢å¼ã§ã¾ã¨ãã¦è¦ããã¨æãã¾ãã
解説ç¯å²ã¯ Arduino IDEã®ã¤ã³ã¹ãã¼ã«ããArduino for Visual Studio Code(以ä¸Arduino for VSCode)ã®å°å
¥ã¾ã§ã§ãã
Arduino for VSCode ã¾ã§å°å ¥ã§ããã¨ãå¿«é©ãªã³ã¼ãç·¨éç°å¢ã«ãªãã®ã§ãªã¹ã¹ã¡ãã¦ãã¾ãããã²å°å ¥ãã¦ã¿ã¦ãã ãããã
Â
ãã®è¨äºã§ã¯ãããªæ¹ã«ãå§ãã§ãã
ã»1ããM5Stackã®éçºç°å¢ãæ´ãããæ¹
ã»å¿«é©ãªã³ã¼ãç·¨éã®ç°å¢ã«ãããæ¹
ã(Arduino-IDEããã¢ããã°ã¬ã¼ãã§ãã¾ãã)
Â
M5Stackãæã£ã¦ããªãæ¹ã¯ãã¡ãã®è¨äºãåèã«ãã¦ã¿ã¦ãã ããã
Â
次åã®äºå®ã¨ãã¦ããã¼ã¸ã§ã³ç®¡çã·ã¹ãã ã®Gitã®å°å ¥ãã¥ã¼ããªã¢ã«ãè¨ç»ãã¦ãã¾ãã
ææ°è¨äºã®æ å ±ãå ¥æãããæ¹ã¯ @harattaMouse ã®ãã©ãã¼ãã¦ããã ããã°ã¨æãã¾ãã
Â
ããã§ã¯ãæ¬é¡ã«ç§»ã£ã¦ããã¾ãããï¼
- ãharattamouseã®å°é¨å±ãã¯ç§»è»¢ãã¾ãããæ°ãã¼ã¸ã¯ ãHaratta-Tech-Labãã§ãã
- M5Stack ã®éçºç°å¢ã«ã¤ãã¦
- Visual Studio Code 㨠Arduino-IDE ã®é¢ä¿
- ãã¥ã¼ããªã¢ã«ã®èª¬æ
- â Arduino IDEã®å°å ¥
- â¡Visual Studio Code ã®å°å ¥
-  â¢Arduinoæ©è½ã®æ¡å¼µÂ
- 4. ãµã³ãã«ãã¢
- 5. ãµã³ãã«ã¹ã±ãããåãã
- ã¾ã¨ã
Â
M5Stack ã®éçºç°å¢ã«ã¤ãã¦
ã¾ãã¯ãM5Stack ã®éçºç°å¢ã«ã¤ãã¦ã§ããM5Stackã®éçºç°å¢ã¯ãè¤æ°ç¨æããã¦ãã¾ãããããããã©ã®ãããªç«ã¡ä½ç½®ã§ãããåãããããã£ãã®ã§ãç°¡åã«å³ã«ã¾ã¨ãã¦ã¿ã¾ããã
M5Stackã®éçºç°å¢ã¯å¤§ããåãã¦3種ã«ãªãã¾ããardiuno IDEãUIFlowãMicropython ãããã¾ããç¾å¨ãM5Cloud㯠ééããã¦ãããUIFlowããªã³ã©ã¤ã³ç°å¢ã¨ãã¦å ¬å¼ã¯æ¨ãã¦ããã®ã§ãMicro pythonã¯ãããªãæ¹ãç¡é£ã ã¨æãã¾ãã
ä»åã¯ã以ä¸ã®ä¸ã® Arduino-IDEã®éçºç°å¢ã¨ Arduino-IDE ãæ¡å¼µãã Arduino for VSCode ã解説ãã¦ããã¾ãã
Â
Visual Studio Code 㨠Arduino-IDE ã®é¢ä¿
 Arduino-IDE 㯠Arduinoãå§ãæ§ã
ãªãã¼ããéçºã§ããå
±æã§ããéçºç°å¢ã§ããArduino-IDE 㧠ããã°ã©ã ã®ç·¨éãã³ã³ãã¤ã«ããã¼ãã¸ã®æ¸ãè¾¼ã¿ãã§ãããã®ãã¼ã«ã§éçºãå®çµãã¦ãã¾ãã
 ããããArduino-IDE ã®å¼±ç¹ã¨ãã¦ãã½ã¼ã¹ã³ã¼ãã®ç·¨éæ©è½ãå¿
è¦æä½éãããªããã¨ãããã¯ã§ããã(çè
㯠é¢æ°ã®å®ç¾©å
ã«é£ã¶æ©è½ãã§ããªãã£ãã®ãè¾ãã£ãã)
ä¸æ¹ãVisual Studio Code(以ä¸VSCodeã¨ç¥ã)ã¯ãMicrosoft社ãéçºãããªã¼ãã³ã½ã¼ã¹ã®å¤æ©è½ãªããã¹ãã¨ãã£ã¿ã§ãã2017å¹´ã« Microsoftå ¬å¼ ã VSCodeã®æ¡å¼µæ©è½ãArduino for VSCode ããªãªã¼ã¹ãã¾ããããããå©ç¨ããã°ãVisual Studio Code ã«ããç·¨éæ¯æ´æ©è½ãIntellSenseæ©è½ããã«ãã«ã¼ã½ã«æ©è½ãå©ç¨ããªãã å¿«é©ã«Arduino éçºãã§ãã¾ãï¼
Â
ãã¥ã¼ããªã¢ã«ã®èª¬æ
ä¸è¨ã®ãããªç°å¢ã«ã¦ããã¥ã¼ããªã¢ã«ãé²ãã¦ããã¾ãã
ã»PC Windows 10 Home
ã»M5Stack 製å
(ä¾ã§ã¯M5Stack Basic ã§ãããM5Stack Gray, M5StickCãªã©ä½ã§ãæ§ãã¾ããã)
ã¾ãåå°ã®â Arduino-IDEãã¤ã³ã¹ãã¼ã«ããâ¡Visual Studio Codeãã¤ã³ã¹ãã¼ã«ãã¾ããæå¾ã«â¢æ¡å¼µæ©è½ã追å ãã¦ç°å¢æ§ç¯å®äºã§ãã
ãã§ã«Arduino-IDEãå°å ¥æ¸ã¿ã®æ¹ã¯â¡ããé²ãã¦è¡ã£ã¦ãã ããã
ããã§ã¯ãM5Stack ã® ç°å¢æ§ç¯ãã¦ããã¾ãããã
Â
åèï¼è§£èª¬åç»ã ä½ãã¾ããï¼ åç»ã§å¦ã³ããæ¹ã¯æ¯éï¼ãã¡ãã§ãâ
M5Stackã®éçºç°å¢ãæ´ãããï¼ãArduino IDEç·¨ã
Â
M5Stackã®éçºç°å¢ãæ´ãããï¼â¡ãVSCodeå°å
¥ç·¨ã
Â
â Arduino IDEã®å°å ¥
1-1 Arduino IDE ã® ã¤ã³ã¹ãã¼ã«
ã¾ããArduino IDE ã ã¤ã³ã¹ãã¼ã«ãã¾ãã
Arduino IDE ã®ãã¼ã¸Â Arduino - Software ãããã¦ã³ãã¼ããã¾ãããã
InstallerçãZipçãAppç ã¨ããã¾ãããInstaller ãé¸æãã¾ãã
ãã¦ã³ãã¼ãåã«ãArduino-IDE éçºã¸ã®æ¯æ´ããã確èªãããã¾ãã
æ¯æ´ãããæ¹ã¯ãContribute&Downloadããé¸æããã¦ã³ãã¼ãã ããªããJust Downloadããé¸æã
ãArduino-1.8.12-windows.exeã(âãããInstaller) ããã¦ã³ãã¼ããããããèµ·åãã¾ãã
Arduino-IDEã®ã¤ã³ã¹ãã¼ã«ããã¾ãããI Agreeããé¸æã
ã¤ã³ã¹ãã¼ã«ããã³ã³ãã¼ãã³ããé¸æãã¾ããä½ãããããããNextããé¸æã
ã¤ã³ã¹ãã¼ã«å ´æãæå®ãã¾ãããã®ã¾ã¾ã®å ´æã§OKãªã®ã§ãInstallããé¸æã
ã¤ã³ã¹ãã¼ã«å®äºã¾ã§ãå¾ ã¡ã¾ããããã¤ã³ã¹ãã¼ã«ãå®äºãããããCloseããé¸æã
Cautionï¼
"Windows app" ã "ã¹ãã¢ããã®ãã¦ã³ãã¼ãç" 㯠å¾ã ã®VSCodeã§èªèããªãåé¡ããããããªã®ã§ãå¿ ãå ¬å¼HPããInstallerçããã¦ã³ãã¼ããã¾ãããã
Â
1-2 ã·ãªã¢ã«éä¿¡ã®ãã©ã¤ãã¤ã³ã¹ãã¼ã«
M5Stackã®ããã°ã©ã æ¸ãè¾¼ã¿ã¯ãã·ãªã¢ã«éä¿¡ã§è¡ã£ã¦ãã¾ãã
PCã®USBä¿¡å·ããã·ãªã¢ã«ä¿¡å·ã«å¤æããéãPCå´ã«ãã©ã¤ããã¤ã³ã¹ãã¼ã«ããã¦ããå¿ è¦ãããã¾ãã
ãã©ã¤ããã¤ã³ã¹ãã¼ã«ãã¾ãããã
https://m5stack.com/pages/download
ã¤ã³ã¹ãã¼ã«ãå®äºããããããã¤ã¹ããã¼ã¸ã£ã¼ããCOMãã¼ãã確èªãã¾ããããä»åã®ä¾ã§ã¯ãCOMãã¼ãçªå·ã¯ COM4 ã§ããã
Â
ä½è«
M5Stackã§ã¯ãCP210x ãå©ç¨ãã¦ãã·ãªã¢ã«éä¿¡ãã¼ãããã¦ããããã§ããCP210x ã®ä»ã«ãFTDIãªã©ãæåã§ãã
Â
1-3 ESP32ãã¤ã³ã³ã®ãã¼ãæ å ±ãåå¾
Arduino-IDEããã¦ã³ãã¼ãããã ãã§ã¯ãM5Stackã®ãã¤ã³ã³(ESP32)ã®ãã¼ãæ å ±ãããã¾ããã®ã§ãESPãã¼ãæ å ±ãåå¾ãã¾ãã
1-3-1 ã©ã¤ãã©ãªããã¼ã¸ã£ã®æ¤ç´¢ç¯å²è¿½å
ã¾ããåæã®ãã¼ãããã¼ã¸ã£ã®æ¤ç´¢ç¯å²ã¯ESP32ã¾ã§åãã§ããªããããESP32ãæ¤ç´¢ã§ããããã«ç°å¢è¨å®ãã¾ãã
[ãã¡ã¤ã«]â[ç°å¢è¨å®]ã¨é¸æããã¨ã¦ã£ã³ãã¦ãéãã¾ãã
éããããã追å ã®ãã¼ãããã¼ã¸ã£ã®URLãã«
https://dl.espressif.com/dl/package_esp32_index.json ãè¨è¼ã
ãOKããé¸æãã¦ãç°å¢è¨å®ã¦ã£ã³ãã¦ãéãã¾ããÂ
Â
1-3-2 ESP32ãã¼ãæ å ±ãåå¾
ã¤ãã«ããã¼ãããã¼ã¸ã£ããespressif社ã®ESP32ãã¼ãæ å ±ãã¤ã³ã¹ãã¼ã«ãã¾ãã
[ãã¼ã«]â[ãã¼ã]â[ãã¼ãããã¼ã¸ã£]ãé¸æã
é¸æããã¨ããã¼ãããã¼ã¸ã£ãéãã¾ããæ¤ç´¢æ¬ã«ãESP32ãã¨æ¤ç´¢ãã¾ããÂ
æ¤ç´¢çµæãããEspressif Systems ã® esp32 ã ã¤ã³ã¹ãã¼ã«ãã¾ãã
ãã°ããã¤ã³ã¹ãã¼ã«ã«æéããããã¾ãã(ver 1.0.4 㧠36853kB ããã¾ããã)
ã¤ã³ã¹ãã¼ã«ãçµããã¾ãããã次ã«ç§»ãã¾ãããã
Note. ä¿åå ´æ
ESP32ã®ãã¼ãæ å ±ã¯ã[ User \ username \ AppData \ Local \ Arduino15 \ package ] ä¸ã«ä¿åããã¦ãã¾ãã
1-3-3 ãã¼ãã®ç¨®é¡ãè¨å®
使ç¨ãããã¼ãæ å ±ãè¨å®ãã¾ãã
[ãã¼ã«]â[ãã¼ã] èªåã®å©ç¨ãããã¼ããé¸æãã¾ãããã(M5Stack-Core-ESP32ãM5Stack-FIREãM5Stick-C ãããã ã¨æãã¾ãã)
ä¾ã§ã¯ãBasicãªã®ã§ãM5Stack-Core-ESP32ããé¸æãã¾ãã
ãã¼ããé¸æããã¨ãå度[ãã¼ã«]ãéãã¨ãéä¿¡è¨å®ãã»ã¼è¨å®ããã¦ãã¾ããã·ãªã¢ã«ãã¼ãã®ã¿ãæåã§è¨å®ãã¾ãããã1-2 ã§ç¢ºèªããCOMãã¼ãçªå·ã«ãªãã¾ããä»åã®ä¾ã§ã¯ãCOM4ã¨ç¢ºèªã§ãã¦ãã¾ããã®ã§ãCOM4ã¨è¨å®ãã¾ãã
Â
1-4 M5Stack Library ãã¤ã³ã¹ãã¼ã«
Ardiuno-IDEã§ã¯ãæ§ã ãªãã¼ãã®ã©ã¤ãã©ãªããã£ã¦ãã¾ããM5Stackå ¬å¼ã«ããã¦ããM5Stack Library ãæä¾ãã¦ãããã¤ã³ã¹ãã¼ã«ãããã¨ã§ M5Stack.h ãå©ç¨ãããã¨ãã§ããããã«ãªãã¾ãã
1-4-1 ã©ã¤ãã©ãªããã¼ã¸ã£èµ·å
ã¤ã³ã¹ãã¼ã«ããããã«ã¯ãã©ã¤ãã©ãªããã¼ã¸ã£ãèµ·åããã¾ãããã[ã¹ã±ãã]â[ã©ã¤ãã©ãªãã¤ã³ã¯ã«ã¼ã]â[ã©ã¤ãã©ãªã管ç] ãé¸æã
æ¤ç´¢æ¬ããM5Stackã¨æã¡è¾¼ã¿ã¾ãã
1-4-2 M5Stack Library ãã¤ã³ã¹ãã¼ã«
M5Stack Library ãé¸æããã¤ã³ã¹ãã¼ã«ãã¾ãã
ã¤ã³ã¹ãã¼ã«ãå®äºãã¦ããã°ã[ãã¡ã¤ã«]â[ã¹ã±ããä¾] ã¨ããã¨ãä¸è¨ã®ããã«ãµã³ãã«ã¹ã±ããã追å ããã¦ããã¯ãã§ãã
Â
Check! ã©ã¤ãã©ãªã®ä¿åå ´æ
éçºãããä¸ã§ã¯ãã©ã¤ãã©ãªã®ãªã³ã¯å ãè¨å®ãããã¨ãå¤ã ããã¾ãã
[ User\ username \ Documents\ Arduino \ libraries ]
ãã¡ãã®å ´æã«ã¤ã³ã¹ãã¼ã«ããã¦ããã¯ãã§ãã®ã§ã確èªãã¦ããã¾ãããã
Â
+α  Arduino Library ã«ã¤ãã¦
Arduino libraryã®æ§æ㯠ã½ã¼ã¹ã³ã¼ãããµã³ãã«ããã°ã©ã (使ç¨ä¾)ã説æè³æ(readme)ãã ãªãã¾ãã
Â
+α  ãµã³ãã«ã¹ã±ãããåãã
ãã㧠Arduino-IDE å°å ¥ã¯å®äºãã¾ããã試ãã«ãµã³ãã«ã³ã¼ããåããã¦ã¿ã¾ãããµã³ãã«ã¨ãã¦ãM5Stack Library ä¸ã® Tetris ãæ¸ãè¾¼ãã§ã¿ã¾ãããã
α-ï¼ï¼ ãã¡ã¤ã«ãããµã³ãã«ã¹ã±ãããé¸æããã
[ãã¡ã¤ã«]â[ã¹ã±ããä¾]â[æ¸ãè¾¼ã¿ããã¹ã±ãã]ãé¸æã
Tetris ã¹ã±ããã®ã¦ã£ã³ãã¦ãç«ã¡ä¸ããã¾ããã
α-ï¼ï¼ãã§ãã¯ãã¼ã¯(æ¤è¨¼)ãé¸æããã¨ãã³ã³ãã¤ã«ãå§ã¾ãã¾ãã
α-ï¼ï¼æ¸ãè¾¼ãåã«ãUSBã§M5Stackãã¤ãªãã¾ãããã
1-2 ã§è¨å®ããCOMãã¼ãã«USBæ¥ç¶ãã¾ãããã
â»COMãã¼ãã®ç¢ºèªã¯ããã¤ã¹ããã¼ã¸ã£ããã§ãã¾ãã(ä¸è¨åè)
α-ï¼ï¼å³ç¢å°ãã¼ã¯(ãã¤ã³ã³ãã¼ãã«æ¸ãè¾¼ã)ãé¸æã
å³ç¢å°ãã¼ã¯ãé¸æãã¦ããã¤ã³ã³ãã¼ãã«ã¹ã±ãããæ¸ãè¾¼ã¿ã¾ãã
α-ï¼ï¼æ¸ãè¾¼ã¿å®äº
ãã°ããããã¨ãæ¸ãè¾¼ã¿çµäºããM5Stackãåæã«èµ·åãã¾ãã
â»ãå³ç¢å°ãã¼ã¯ãã¯ãæ¤è¨¼ããåæã«ãã£ã¦ããããããα-ï¼çªã®æé ã¯é£ã°ãã¦ãåé¡ããã¾ããã
Â
â¡Visual Studio Code ã®å°å ¥
2-1. Visual Studio Code ã®ã¤ã³ã¹ãã¼ã«
ã¤ãã¯ãVisual Studio Code ãã¤ã³ã¹ãã¼ã«ã§ãã
ãã¡ããããã¦ã³ãã¼ããã¾ããhttps://code.visualstudio.com/download
VSCodeUserSetup-x64-1.xx.x.exe ãé¸æã¨ä¸è¨ã®ã¦ã£ã³ãã¦ãéãã
使ç¨è¨±è«¾å¥ç´æ¸ãèªãã§ãåæãããé¸æãã次ã¸ãã
ããã°ã©ã ã®ä¿åå ´æã¯å¤æ´ããã次ã¸ããé¸æã
ã¹ã¿ã¼ãã¡ãã¥ã¼ã«ã·ã§ã¼ãã«ãããä½æããã次ã¸ã
諸ã ã®è¨å®ããªã¹ã¹ã¡ã¯ãã§ãã¯ãã¼ã¯ãä»ãã¦ã次ã¸ã
ãã¤ã³ã¹ãã¼ã«ããé¸æã
ã¤ã³ã¹ãã¼ã«ãå®äºãã¾ããããå®äºããé¸æã
2-2. VSCode èµ·åå¾ã®åæè¨å®
2-2-1. æ¥æ¬èªã®å¤æ´
ã¾ããæ¥æ¬èªã«å¤æ´ãã¾ãã
ãExtensions (ãããã¯ï¼ã¤ã®ã¢ã¤ã³ã³)ããé¸æãã¾ãã
æ¤ç´¢æ¬ã« "japanese" ãæ¤ç´¢ãã¾ããæ¤ç´¢çµæãããæ¥æ¬èªãé¸æãã¾ãã
ãInstallããé¸æãã¾ãã
ã¤ã³ã¹ãã¼ã«å¾ãVSCodeãåèµ·åããã¨æ¥æ¬èªã«å¤æ´ããã¦ãã¾ãã
2-2-2. é è²ãã¼ãã®è¨å®
é è²ãã¼ããå¤ãã¦ã¿ã¾ãã
[ãã¼ã«]â[åºæ¬è¨å®]â[é è²ãã¼ã] ãé¸æã
好ããªé
è²ãã¼ããé¸æãã¾ãããã
ä»åã¯ãMonokai Dimmedãã«è¨å®ãã¾ãããå°å³ã«å¤ãã£ã¦ãã¾ãã
ãMonokai Dimmedãã¯ãããªæãã
Â
 â¢Arduinoæ©è½ã®æ¡å¼µÂ
VSCodeãå°å ¥ã§ãã¾ããã®ã§ãArduino for Visual Studio Code ã追å ãã¦ããã¾ãã
3-1.  Arduino for Visual Studio Code ãã¤ã³ã¹ãã¼ã«
ãExtensionsããé¸æããarduino ã¨æ¤ç´¢ãã¾ãã
Arduino ã§ãããããæ¡å¼µæ©è½ã¯è¤æ°ååºã¦ãã¾ãããMicrosoft社ã®Arduinoãé¸æããã¤ã³ã¹ãã¼ã«ãã¾ãã
3-2. Arduino for VSCode åæè¨å®Â
åæè¨å®ããããªãã¾ãã
3-2-1. Arduino:Path ã®è¨å®
Arduino for VSCode ã§ã¯ãArduinoã®ãã¼ã«ãã§ã¼ã³ãå©ç¨ãããããArduinoã®ãã¹ãæå®ããå¿ è¦ãããã¾ãã
[ãã¡ã¤ã«]â[åºæ¬è¨å®]â[è¨å®] ãé¸æãã¾ãã
[æ¡å¼µæ©è½]â[Arduino configuration] ãã Arduino:Path ãæ¢ãã
C:\Program Files (x86)\Arduino ãæå®ãã¾ãã
3-2-2. IntelliSense ã®åæè¨å® (C/C++ æ¡å¼µæ©è½)
Arduino for VSCode ãã¤ã³ã¹ãã¼ã«ããéãC/C++æ¡å¼µæ©è½ãåæã«ã¤ã³ã¹ãã¼ã«ããã¦ãã¾ããããã¯ãArduino for VSCode㧠IntelliSenseãå©ç¨ããããã§ããÂ
IntelliSenseã®è¨å®ãè¡ãã¾ãã
VSCodeè¨å®ç»é¢ããã"IntelliSense engine" ã¨æ¤ç´¢ãããDefaultãâãTag Parserã ã¸å¤æ´ãã¾ãã
3-2-3. Arduino ã³ã³ãã¤ã«åºåã®æååã対ç
 ã¿ã¼ããã«ã®æååã対çãè¡ãã¾ãã
ä¸è¨ã® JavaScript ãã¡ã¤ã«ãè¦ã¤ãã¾ãã
C:\Users\username\.vscode\extensions\vsciot-vscode.vscode-arduino-0.3.0\out\src\common\util.jsÂ
218è¡ç®ãã³ã¡ã³ãã¢ã¦ããã¾ããã
ããã§æååã対çã¯å®äºãã¾ããã
åèå
ãã¡ãã®è¨äºãåèã«ãã¾ããã
Arduino for Visual Studio Codeåºåã®æååã対ç â Lang-ship
Â
以ä¸ã§ãArduino for VSCode ã®è¨å®ãå®äºãã¾ããã
Â
4. ãµã³ãã«ãã¢
ï¼ããããã°ã©ã ãããã¨ãã®ãã¥ã¼ããªã¢ã«ãè¡ãã¾ãã
4-1. ããã¸ã§ã¯ããã©ã«ãä½æ
ã¾ããããã¸ã§ã¯ããã©ã«ããä½æãã¾ãã
[ãã¡ã¤ã«]â[ãã©ã«ããéã] ããã好ããªå ´æã«ãã©ã«ããæ°è¦ä½æããéãã¾ãã
ä»åã¯ã"Demo" ã¨ãããã©ã«ããä½ãã¾ããC:\Users\username\Documents\Arduino ã«ãã©ã«ããä½æãã¾ããã空ã®"Demo"ãé¸æããããã©ã«ãã®é¸æã
ãæ°ãããã¡ã¤ã«ããã¯ãªãã¯ãã¦ã"Demo.ino" ãã¡ã¤ã«ãä½æãã¾ãã
Arduinoã¹ã±ããã®Defaultã³ã¼ããæ¸ãã¦ã¿ã¾ããã
4-2. ãã¼ã種é¡é¸æ
ããã§ãã¼ãã®é¸æãã¾ããCtrl+Shift+P 㧠Arduino : Board Config ãé¸æ
Selected Board ãé¸æãM5Stack-Core-ESP32(esp32)ãããã¨ã"Flash Mode"ã"Flash Frequency"çã®é ç®ãèªåã§è¨å®ããã¾ãã
4-3. C/C++æ¡å¼µæ©è½ã®ãã¹è¿½å
VSCodeã® IntelliSenseãæ©è½ãããããã«ã¯ããã®ããã¸ã§ã¯ãã§å©ç¨ããã¤ã³ã¯ã«ã¼ããã¹ãæå®ããå¿ è¦ãããã¾ãã
ã¨ã¯ã¹ããã¼ã©ä¸ã® [.vscode]â[c_cpp_propaties] ãé¸æãã¾ãã
ä»åã¯ãM5Stack.hãå©ç¨ãã¾ãã®ã§ãä¸è¨ã®ãã¹ã追å ãã¾ãã
"C:\\User\\username\\Documents\\Arduino\\libraries\\**"
4-4. ã·ãªã¢ã«ãã¼ãã®è¨å®
ã·ãªã¢ã«ãã¼ããè¨å®ãã¾ããäºåã«M5StackãUSBæ¥ç¶ãã¦ããã¾ãã
Ctrl+Shift+P ã«ã¦ããArduino : Select Serial Portã ãé¸æãã¾ãã
ä¾ã§ã¯ãCOM4ãé¸æãã¾ããã
4-5. ã½ã¼ã¹ã³ã¼ãã®ç·¨é
次ã«ãã½ã¼ã¹ã³ã¼ããæ¸ãã¾ãã
M5Stack Library ãå©ç¨ããç°¡åãªããã°ã©ã ã§ããï¼ç§ããã«M5Stackã®ç»é¢ã«Hello world ãåºåãããåæã«ã·ãªã¢ã«ã¢ãã¿ã¼ã«ãHello Worldãåºåããã¾ãã
gist1ba8ec405d2253e0d6f73b8bfda7177f
Â
4-6. M5Stack ã¸ã®æ¸ãè¾¼ã¿
ã½ã¼ã¹ã³ã¼ããæ¸ãã¾ããããM5Stackã«æ¸ãè¾¼ã¿ã¾ãããVerifyãã¢ã¤ã³ã³ãé¸æããã¨ã³ã³ãã¤ã«ãå§ã¾ãã¾ãã
ã³ã³ãã¤ã«ãå®äºããããM5StackãUSBæ¥ç¶ãã¾ãããããUploadããã¿ã³ãé¸æããã¨æ¸ãè¾¼ã¿ãè¡ããã¾ãã
赤丸ã®ãOpen Serial Monitorããé¸æãã¦ãã·ãªã¢ã«éä¿¡ãéå§ãã¾ããM5Stackç»é¢ã«ãHello World!ãã¨ï¼ç§ããã«LCD表示ãããã·ãªã¢ã«éä¿¡ã確èªã§ãã¾ãããÂ
ããã¾ã§ã§ããã°ãVSCodeã§ããã°ã©ã éçºãã§ãã¾ããï¼
Â
5. ãµã³ãã«ã¹ã±ãããåãã
Arduino for VSCode ã§ããµã³ãã«ã³ã¼ããåããã¦ã¿ã¾ãããã
5-1. ãµã³ãã«ã¹ã±ãããé¸æ
Ctrl+Shift+P 㧠arduino example ãé¸æãã¾ãã
Arduino ã®åæã©ã¤ãã©ãªããM5Stack Library ã® sample skech ãé¸æã§ãã¾ããÂ
ä»åã¯ãFlappyBird ãé¸æãã¾ããã
FlappyBirdã®ã½ã¼ã¹ã³ã¼ãã
5-2. ãµã³ãã«ã¹ã±ããã®æ¸ãè¾¼ã¿
ãµã³ãã«ã¹ã±ããã¯åºæ¬çã«æãå ããªãã¦ãåãã¨æãã¾ãã®ã§ãã¡ã¤ã³ã®.ino ãã¡ã¤ã«ãéãã¦ããuploadããæ¼ãã ãã§ãã
M5Stackã«æ¸ãè¾¼ã¿ã§ããã¨æãã¾ãã
ã¾ã¨ã
Arduino for VSCodeã¾ã§å°å ¥ã§ããã°ãä¸èªç±ãªãéçºç°å¢ããªã¨æãã¾ããå人çã«ã¯ãã¨ã©ã¼ã¡ãã»ã¼ã¸ããã£ã¨è¦ããããªãã°ãããããªã¨æã£ã¦ããããã¾ãã
Â
次åãGit(Hub)ã®å°å ¥ãã¥ã¼ããªã¢ã«ã解説ãã¦ããããã¨æãã¾ãã
次ã®è¨äºã§ãä¼ããã¾ãããï¼