Skip to content

Commit 06c162e

Browse files
committed
Updated readme
1 parent d7e4588 commit 06c162e

File tree

1 file changed

+48
-37
lines changed

1 file changed

+48
-37
lines changed

README.md

Lines changed: 48 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ The command will create a new empty sketch named MyFirstSketch in the default di
3636
$ arduino-cli sketch new MyFirstSketch
3737
Sketch created in: /home/luca/Arduino/MyFirstSketch
3838

39-
$ cat /home/luca/Arduino/MyFirstSketch/MyFirstSketch.ino
39+
$ cat /home/luca/Arduino/MyFirstSketch/MyFirstSketch.ino
4040
void setup() {
4141
}
4242

@@ -48,17 +48,23 @@ Use your favourite file editor or IDE to modify the .ino file under: `$HOME/Ardu
4848
and change the file to look like this one:
4949

5050
void setup() {
51-
pinMode(LED_BUILTIN, OUTPUT);
51+
pinMode(LED_BUILTIN, OUTPUT);
5252
}
53+
5354
void loop() {
54-
digitalWrite(LED_BUILTIN, HIGH);
55-
delay(1000);
56-
digitalWrite(LED_BUILTIN, LOW);
57-
delay(1000);
55+
digitalWrite(LED_BUILTIN, HIGH);
56+
delay(1000);
57+
digitalWrite(LED_BUILTIN, LOW);
58+
delay(1000);
5859
}
5960

6061
### Step 3. Connect the board to your PC
61-
Just connect the board to your PCs by using the USB cable. In this example we will use the MKR1000 board.
62+
If you are running a fresh install of the arduino-cli you probably need to update the platform indexes by running:
63+
64+
$ arduino-cli core update-index
65+
Updating index: package_index.json downloaded
66+
67+
Now, just connect the board to your PCs by using the USB cable. In this example we will use the MKR1000 board.
6268

6369
$ arduino-cli board list
6470
FQBN Port ID Board Name
@@ -73,57 +79,65 @@ We have to look at the core available with the `core search` command. It will pr
7379
$ arduino-cli core search arduino
7480
Searching for platforms matching 'arduino'
7581

76-
ID Version Installed Name
77-
Intel:arc32 2.0.2 No Intel Curie Boards
78-
arduino:avr 1.6.21 No Arduino AVR Boards
79-
arduino:nrf52 1.0.2 No Arduino nRF52 Boards
80-
arduino:sam 1.6.11 No Arduino SAM Boards (32-bits ARM Cortex-M3)
82+
ID Version Installed Name
83+
Intel:arc32 2.0.2 No Intel Curie Boards
84+
arduino:avr 1.6.21 No Arduino AVR Boards
85+
arduino:nrf52 1.0.2 No Arduino nRF52 Boards
86+
arduino:sam 1.6.11 No Arduino SAM Boards (32-bits ARM Cortex-M3)
8187
arduino:samd 1.6.18 No Arduino SAMD Boards (32-bits ARM Cortex-M0+)
82-
arduino:stm32f4 1.0.1 No Arduino STM32F4 Boards
83-
littleBits:avr 1.0.0 No littleBits Arduino AVR Modules
88+
arduino:stm32f4 1.0.1 No Arduino STM32F4 Boards
89+
littleBits:avr 1.0.0 No littleBits Arduino AVR Modules
90+
91+
If you're unsure you can try to refine the search with the board name
8492

85-
The right one for the Arduino MKR1000 is arduino:samd, now we can install it
93+
$ arduino-cli core search mkr1000
94+
Searching for platforms matching 'mkr1000'
95+
96+
ID Version Installed Name
97+
arduino:samd 1.6.19 No Arduino SAMD Boards (32-bits ARM Cortex-M0+)
98+
99+
So, the right platform for the Arduino MKR1000 is arduino:samd, now we can install it
86100

87101
$ arduino-cli core install arduino:samd
88102
Downloading tools...
89-
arduino:arm-none-eabi-gcc@4.8.3-2014q1 downloaded
103+
arduino:arm-none-eabi-gcc@4.8.3-2014q1 downloaded
90104
arduino:bossac@1.7.0 downloaded
91-
arduino:openocd@0.9.0-arduino6-static downloaded
92-
arduino:CMSIS@4.5.0 downloaded
93-
arduino:CMSIS-Atmel@1.1.0 downloaded
94-
arduino:arduinoOTA@1.2.0 downloaded
105+
arduino:openocd@0.9.0-arduino6-static downloaded
106+
arduino:CMSIS@4.5.0 downloaded
107+
arduino:CMSIS-Atmel@1.1.0 downloaded
108+
arduino:arduinoOTA@1.2.0 downloaded
95109
Downloading cores...
96-
arduino:samd@1.6.18 downloaded
110+
arduino:samd@1.6.19 downloaded
97111
Installing tools...
98112
Installing platforms...
99113
Results:
100-
arduino:samd@1.6.18 - Installed
101-
arduino:arm-none-eabi-gcc@4.8.3-2014q1 - Already Installed
102-
arduino:bossac@1.7.0 - Already Installed
103-
arduino:openocd@0.9.0-arduino6-static - Already Installed
104-
arduino:CMSIS@4.5.0 - Already Installed
105-
arduino:CMSIS-Atmel@1.1.0 - Already Installed
106-
arduino:arduinoOTA@1.2.0 - Already Installed
114+
arduino:samd@1.6.19 - Installed
115+
arduino:arm-none-eabi-gcc@4.8.3-2014q1 - Installed
116+
arduino:bossac@1.7.0 - Installed
117+
arduino:openocd@0.9.0-arduino6-static - Installed
118+
arduino:CMSIS@4.5.0 - Installed
119+
arduino:CMSIS-Atmel@1.1.0 - Installed
120+
arduino:arduinoOTA@1.2.0 - Installed
107121

108122
Now verify we have installed the core properly by running
109123

110124
$ arduino-cli core list
111-
ID Installed Latest Name
112-
arduino:samd 1.6.18 1.6.18 Arduino SAMD Boards (32-bits ARM Cortex-M0+)
125+
ID Installed Latest Name
126+
arduino:samd 1.6.19 1.6.19 Arduino SAMD Boards (32-bits ARM Cortex-M0+)
113127

114128

115129
We can finally chek if the board is now recognized as a MKR1000
116130

117131
$ arduino-cli board list
118-
FQBN Port ID Board Name
132+
FQBN Port ID Board Name
119133
arduino:samd:mkr1000 /dev/ttyACM0 2341:804E Arduino/Genuino MKR1000
120-
134+
121135
Great! Now the Board FQBN (Fully Qualified Board Name) and the Board Name look good, we are ready to compile and upload the sketch
122136

123137
### Step 5. Compile the sketch
124138
To compile the sketch we have to run the `compile` command with the proper FQBN we just got in the previous command.
125139

126-
arduino-cli compile --fqbn arduino:samd:mkr1000 Arduino/MyFirstSketch
140+
$ arduino-cli compile --fqbn arduino:samd:mkr1000 Arduino/MyFirstSketch
127141
Sketch uses 9600 bytes (3%) of program storage space. Maximum is 262144 bytes.
128142

129143
### Step 6. Upload your sketch
@@ -190,7 +204,7 @@ We are now ready to install it! Please be sure to use the full name of the lib a
190204

191205
$ arduino-cli lib install "WiFi101"
192206
Downloading libraries...
193-
WiFi101@0.15.2 downloaded
207+
WiFi101@0.15.2 downloaded
194208
Installed WiFi101@0.15.2
195209

196210
## Inline Help
@@ -213,11 +227,8 @@ Available Commands:
213227
core Arduino Core operations.
214228
help Help about any command
215229
lib Arduino commands about libraries.
216-
login Creates default credentials for an Arduino Create Session.
217-
logout Clears credentials for the Arduino Create Session.
218230
sketch Arduino CLI Sketch Commands.
219231
upload Upload Arduino sketches.
220-
validate Validates Arduino installation.
221232
version Shows version number of arduino CLI.
222233
....
223234
```

0 commit comments

Comments
 (0)