#organize #codebase #arduino
I used to have long Arduino *.ino sketch files that were difficult to debug and add features. In this video, I share several incremental steps to take to split a big Arduino code file into separate different files and folders for future maintainability. Plus, we will use Arduino CLI to install libraries and track its version. We will use the Arduino Nano 33 BLE Sense board for a practical example in one file before splitting the code into manageable bits.
⏰ TIMESTAMPS
0:00 Intro
02:17 Create new codebase
06:52 Step 1: Install library
09:50 Step 2: Split code into *.ino files
11:31 Step 3: Create header files
13:07 Step 4: Create header and cpp files
15:08 Step 5: Create src folder
17:30 Step 6: Enable multiple tasks in loop()
20:15 Outro
‣ Some links below are affiliate. I receive a small commission at no extra cost to you.
🎩 DEMO FILES
Display IMU data with LSM9DS1 and Arduino Nano 33 BLE Sense board hutscape.com/tutorials/nano33...
Display temperature and humidity data with HTS221 hutscape.com/tutorials/nano33...
Split up code into more *.ino files hutscape.com/tutorials/nano33...
Separate files into the header and c++ files hutscape.com/tutorials/nano33...
Adding header and cpp files to Arduino folder hutscape.com/tutorials/more-f...
📺 WATCH NEXT
6 ways to access the serial monitor for Arduino • 6 ways to access the s...
Arduino CLI and the art of command line • Arduino CLI and the ar...
Makefiles for using with Arduino • Makefiles for using wi...
Debugging Arduino firmware with print statements • Debugging Arduino firm...
🔗 LINKS SHOWN
Arduino Nano 33 BLE Sense board store.arduino.cc/usa/nano-33-...
Getting started with the Arduino NANO 33 BLE Sense www.arduino.cc/en/Guide/NANO3...
Arduino LSM9DS1 IMU library github.com/arduino-libraries/...
Simple accelerometer example code github.com/arduino-libraries/...
Arduino HTS221 sensor library github.com/arduino-libraries/...
Read sensor example code github.com/arduino-libraries/...
Arduino CLI library specification arduino.github.io/arduino-cli...
Arduino Sketch build process arduino.github.io/arduino-cli...
Arduino Sketch specification arduino.github.io/arduino-cli...
Arduino millis() www.arduino.cc/reference/en/l...
Writing a library for Arduino www.arduino.cc/en/Hacking/lib...
🔌 TOOLS USED
hutscape.com/tools
Негізгі бет Ғылым және технология Organise large Arduino codebase with libraries, files and folders // Arduino CLI, Nano 33 BLE Sense
Пікірлер: 22