《Arduino-to-RTOS.pptx》由會員分享,可在線閱讀,更多相關《Arduino-to-RTOS.pptx(46頁珍藏版)》請在三個皮匠報告上搜索。
1、Blues Notecard 30mm x 35mmArduino to RTOSA Pilgrims ProgressTJ VanToll&Zak FieldsDeveloper RelationsTJ VanTollPrincipal Developer AdvocatetjvantollZak FieldsStaff Experience EngineerzfieldsArduino to RTOSA Pilgrims Progress67“Each lesson supports 3 device choices-Arduino,or a single-board computer,e
2、ither a physical device(a Raspberry Pi 4)or a virtual single-board computer running on your PC or Mac.”https:/ for Beginners by Microsoft8910Myths#1:Platforms like Arduino and Raspberry Pi are only for beginners.#2:RTOS platforms are impossibly complex and only for“real”engineers building“real”proje
3、cts.12What youll learn Using an RTOS is possible,and the best path forward for many IoT Projects.When an RTOS is a good fit,and when its overkill.The pros and cons of Zephyr in action.Easy for developers and affordable for all.15Notecard Low-power system-on-module Global cellular/GPS or Wi-Fi 500MB
4、cell data+10 years service JSON-based API NB-IoT,LTE-M,LTE Cat-1 Python,Go,Arduino,C/C+,Zephyr“Device-to-Cloud Data Pump”*Actual wiring may vary1924Myths#1:Platforms like Arduino and Raspberry Pi are only for beginners.#2:RTOS platforms are impossibly complex and only for“real”engineers building“rea
5、l”projects.Zak FieldsStaff Experience EngineerzfieldsArduino:Quick Recap26.Arduino:Quick Recap27Fast and Easy.Arduino:Quick Recap28Fast and EasyPowerful.Arduino:Quick Recap29Fast and EasyPowerfulBroad Support.Arduino:Quick Recap30Fast and EasyPowerfulBroad SupportCommunity Arduino:The Dark Side31.ID
6、E 1.x-no debuggingIDE 2.x-only supports Arduino boardsVS Code ExtensionPlatform.ioArduino:The Dark Side32Disjoint Debugging Experience.IDE 1.x-no debuggingIDE 2.x-only supports Arduino boardsVS Code ExtensionPlatform.ioArduino:The Dark Side33Multiple authors with varying level of skill.Each library
7、has a unique license.No guarantee of portability.Disjoint Debugging ExperienceLibrary System:Powerful but Inconsistent.IDE 1.x-no debuggingIDE 2.x-only supports Arduino boardsVS Code ExtensionPlatform.ioArduino:The Dark Side34Multiple authors with varying level of skill.Each library has a unique lic
8、ense.No guarantee of portability.Arduino API is small.Testing is difficult.Each BSP has bespoke implementations of threading,radios,etc.Disjoint Debugging ExperienceLibrary System:Powerful but InconsistentComplex Code is Not Portable/MaintainableFor the wind.Native Threading/Timer SupportTwister Tes
9、ting FrameworkSupport for DebuggingNative Sensor Librariesint 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 Struc
10、turestatic 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);digit
11、alWrite(LED_BUILTIN,LOW);delay(250);Zephyr:BlinkyZephyr uses devicetree to describe:the hardware available on its Supported Boards that hardwares initial configurationZephyr:DevicetreeSo,what does that mean for you?Zephyr:Getting StartedEasy?_()_/Zephyr:Getting Started+=Easy.https:/blues.dev/zephyrhttps:/ Code:Revisit Demo44 Emulate the Arduino RuntimeTalk to the BME280the Zephyr way.45 blues.dev for Blues resourcesThanks!(Time for Q&A)