-
Notifications
You must be signed in to change notification settings - Fork 2
First time use
Automatic installation of arduino-cli is not yet implemented. In the interim you need to do this manually.
You must also provide the path to
arduino-cli.exein extension settings (see manual installation instructions).
When you open an arduino project that you have not previously opened with this extension, VS Code will look like the following illustration. Look at the right hand end of the status bar.

-
M:undefinedmeans you have yet to set a serial monitor port. -
Choose a boardmeans what it says.
Click on Choose a board to make QuickPick list appear:

Type the name of your board. VS Code will do fancy progressive matching until you find and click your board.
I have a Nano:

Notice that the vanilla Nano says it uses arduino:avr whereas other flavours say they will install other cores. This is because I have already installed the arduino:avr core. If you select a board that requires a core that isn't installed the extension will install it.
Now that the extension knows what board you have it will prompt you to pick a serial port. Currently this fails to populate the list. Click on M:undefined and it will retry successfully. If you click on D:NOT SET you will get a list of deployment methods which includes all the hardware programmers supported by your board and all the detected USB serial ports.

When you open the INO file, Compile and Deploy commands should appear at top right, like this:

The Flash command will not appear until you specify a hardware programmer because you can't flash the bootloader without one. Notice that I have already selected the USBasp programmer in this snap.
With the extension installed and an INO file open, click Compile. When the dust settles, you should see something similar to this.

In the OUTPUT pane compilation results are displayed. In settings you can request verbose compiler output.
Deploy compiles before it deploys. You don't need to compile first.
With the extension installed and an INO file open, click Deploy.
As with Compile, results are displayed in the OUTPUT pane. Deploy results are always verbose because in addition to providing better feedback in a potentially slow operation, it allows the extension to detect failure/retry and abort instead of silently trying a sixty second operation ten times.
Here is a sample successful deployment using a USBasp programmer.
Sketch uses 9452 bytes (30%) of program storage space. Maximum is 30720 bytes.
Global variables use 884 bytes (43%) of dynamic memory, leaving 1164 bytes for local variables. Maximum is 2048 bytes.
"C:\Users\Peter\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude" "-CC:\Users\Peter\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf" -v -V -patmega328p -cusbasp -Pusb "-Uflash:w:d:\Arduino\ArduinoPumpController\build\arduino.avr.nano/ArduinoPumpController.ino.hex:i"
avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "C:\Users\Peter\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"
Using Port : usb
Using Programmer : usbasp
AVR Part : ATmega328P
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PC2
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 65 20 4 0 no 1024 4 0 3600 3600 0xff 0xff
flash 65 6 128 0 yes 32768 128 256 4500 4500 0xff 0xff
lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
Programmer Type : usbasp
Description : USBasp, http://www.fischl.de/usbasp/
avrdude: auto set sck period (because given equals null)
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.01s
avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: auto set sck period (because given equals null)
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: reading input file "d:\Arduino\ArduinoPumpController\build\arduino.avr.nano/ArduinoPumpController.ino.hex"
avrdude: writing flash (9452 bytes):
Writing | ################################################## | 100% 6.16s
avrdude: 9452 bytes of flash written
avrdude done. Thank you.