Arduino to RTOS—A Pilgrim’s Progress
TJ VanToll & Zak Fields
Developer Relations
Blues Notecard 30mm x 35mm
TJ VanToll
Principal Developer Advocate
@tjvantoll
Zak Fields
Staff Experience Engineer
@zfields
Arduino to RTOS—A Pilgrim’s Progress
6
“Each lesson supports 3 device choices - Arduino, or a single-board computer, either a physical device (a Raspberry Pi 4) or a virtual single-board computer running on your PC or Mac.”
7
- IoT for Beginners by Microsoft
8
9
10
Myths
12
What you’ll learn
Easy for developers and affordable for all.
15
Notecard
“Device-to-Cloud Data Pump”
🔒
*Actual wiring may vary
19
24
Myths
Zak Fields
Staff Experience Engineer
@zfields
Arduino:�Quick Recap
.
.
.
.
.
.
.
.
26
Arduino:�Quick Recap
Fast and Easy
✅
.
.
.
.
.
.
27
Arduino:�Quick Recap
Fast and Easy
✅
Powerful
💪
.
.
.
.
28
Arduino:�Quick Recap
Fast and Easy
✅
Powerful
💪
Broad Support
⚙️
.
.
29
Arduino:�Quick Recap
Fast and Easy
✅
Powerful
💪
Broad Support
⚙️
Community
🧑👨🔧
👩🔬👨🏿🚀
30
Arduino:�The Dark Side
.
.
.
.
.
.
31
Arduino:�The Dark Side
IDE 1.x - no debugging
IDE 2.x - only supports Arduino boards
VS Code Extension
Platform.io
Disjoint Debugging Experience
.
.
.
.
32
Arduino:�The Dark Side
IDE 1.x - no debugging
IDE 2.x - only supports Arduino boards
VS Code Extension
Platform.io
Multiple authors with varying level of skill.
Each library has a unique license.
No guarantee of portability.
Disjoint Debugging Experience
Library System:
Powerful but Inconsistent
.
.
33
Arduino:�The Dark Side
IDE 1.x - no debugging
IDE 2.x - only supports Arduino boards
VS Code Extension
Platform.io
Multiple authors with varying level of skill.
Each library has a unique license.
No guarantee of portability.
Arduino API is small.
Testing is difficult.
Each BSP has bespoke implementations of threading, radios, etc.
Disjoint Debugging Experience
Library System:
Powerful but Inconsistent
Complex Code is Not Portable/Maintainable
34
For the win[d]...
Native Threading/Timer Support��Twister Testing Framework��Support for Debugging��Native Sensor Libraries
int main (void) {
// put your setup code here, to run once:
while (1) {
// put your main code here, to run repeatedly:
}
return 0;�}
void setup (void) {
// put your setup code here, to run once:
}
void loop (void) {
// put your main code here, to run repeatedly:
}
Zephyr: Basic Structure
static const struct gpio_dt_spec led = GPIO_DT_SPEC_GET(DT_ALIAS(led0),gpios);
int main (void) {
gpio_pin_configure_dt(&led,GPIO_OUTPUT_ACTIVE);
while (1) {
gpio_pin_toggle(&led);
k_msleep(250);
}
return 0;�}
void setup (void) {
pinMode(LED_BUILTIN,OUTPUT);
}
void loop (void) {
digitalWrite(LED_BUILTIN,HIGH);
delay(250);
digitalWrite(LED_BUILTIN,LOW);
delay(250);
}
Zephyr: Blinky 🤔
Zephyr uses devicetree to describe:
Zephyr: Devicetree
So, what does that mean for you?
Zephyr: Getting Started
Easy?� ¯\_(ツ)_/¯
Zephyr: Getting Started
+
=
Easy.
😎
https://blues.dev/zephyr
https://github.com/blues/note-zephyr.git
+
VS Code: Revisit Demo
44
👈 Emulate the Arduino Runtime
Talk to the BME280
the Zephyr way... 👉
45
Thanks! (Time for Q&A)