We’ll not reproduce the Arduino Software Guide here, but here’s how you install the Arduino IDE, The Things Network library and perform some common tasks.
Setup the Arduino IDE and install The Things Network Library.
The Arduino IDE will notify you of updates for the IDE and Library automagically.
Most sketches write debug logs to the (emulated) Serial Port for the USB connection. You can monitor these logs via the Arduino IDE’s Serial Monitor.
Ctrl/⌘ Shift
M
.Uploads might fail if you have the monitor open. Close it and try again. Visa versa an upload might break the monitor. Make sure the right port is still selected and re-open the monitor.
You will only see logs from the moment when you opened the Serial Monitor. Use delay()
or the
following while()
to give yourself some time to open Serial Monitor:
#define debugSerial Serial
void setup()
{
debugSerial.begin(9600);
// Wait a maximum of 10s for Serial Monitor
while (!debugSerial && millis() < 10000);
// Your setup
}
When you upload a sketch to your Arduino it will first compile and fail if your sketch has errors. If there are no errors it will continue to upload.
Ctrl/⌘ U
to compile
and upload your sketch.The Arduino IDE will give feedback which should look like:
Sketch uses 9,656 bytes (33%) of program storage space. Maximum is 28,672
bytes.
Global variables use 1,253 bytes (48%) of dynamic memory, leaving 1,307 bytes for local variables. Maximum
is 2,560 bytes.
Uploads might fail if you have the monitor open. Close it and try again.
You can also compile your code without uploading to verify it has no errors:
Ctrl/⌘ R
to
check your sketch for errors.