The environment is Ubuntu 20.
Download and install Arduino in/opt /.
wget https://downloads.arduino.cc/arduino-1.8.13-linux64.tar.xz ;
tar xvf arduino-1.8.13-linux64.tar.xz ;
sudo mv arduino-1.8.13-linux64 /opt/ ;
cd opt arduino-1.8.13-linux64/ ;
sudo ./install ;
vscode installation
Download from the official website
https://code.visualstudio.com/download
Since it is Ubuntu, select deb to download the file and install it.
sudo apt install ~/Downloads/code_* ;
launch vscode
code ;
Make vscode recognize Arduino.
First, install the extension Arduino (made by Microsoft)
ctrl + shift + x
Or
File -> Preferences -> Extensions
Select Arduino (made by Microsoft)
Next, set the path of the installed Arduino in/opt /. Open the settings screen
ctrl + ,
Or
File -> Preferences -> Settings
item | Set value |
---|---|
Arduino: Command Path | arduino |
Arduino: Path | /opt/arduino-1.8.13 |
Open the sample program
ctrl + shift + p
↓
Arduino:Examples
Specify the board.
ctrl + shift + p
↓
Arduino:Board Config
Example)
item | Set value |
---|---|
Selected Board | Arduino Nano |
Prosessor | ATmega328P(Old Bootloader) |
Upload sketch to board
ctrl + alt + u
Specify serial port Example) ttyUSB0
Allows the usb serial port to be written.
sudo chmod a+rw /dev/ttyUSB0 ;
However, since it is troublesome to type the command every time, I will write the rule in udev.
sudo gedit /lib/udev/rules.d/50-udev-default.rules;
# serial
KERNEL=="tty[A-Z]*[0-9]|pppox[0-9]*|ircomm[0-9]*|noz[0-9]*|rfcomm[0-9]*", GROUP="dialout", MODE="0666"
Serial monitor display
ctrl + shift + p
Arduino:Open Serial Monitor
I often use it, so I think you can assign a shortcut by clicking the gear next to the text.
Specify the transfer speed for the USB type. Click the number 115200 at the bottom right of the window Example) 9600
Recommended Posts