Reader small image

You're reading from  Practical Arduino Robotics

Product typeBook
Published inMar 2023
PublisherPackt
ISBN-139781804613177
Edition1st Edition
Tools
Concepts
Right arrow
Author (1)
Lukas Kaul
Lukas Kaul
author image
Lukas Kaul

Lukas Kaul is a robotics Research Scientist, currently working at the Toyota Research Institute in Silicon Valley, where he develops mobile manipulation technologies to support people in their homes and in their workplace. Throughout his career he has worked on projects as diverse as humanoid robots, aerial robots and mobile manipulation systems. A maker at heart, Lukas has been using Arduino technology extensively for more than a decade in countless side-projects, ranging from mapping systems to self-balancing robots. Lukas is passionate about teaching robotics with Arduino to inspire and empower anyone who wants to enter the exciting field of robotics. He holds a PhD degree from the Karlsruhe Institute of Technology, Germany.
Read more about Lukas Kaul

Right arrow

Blocking and non-blocking function calls

To successfully implement cooperative multitasking, each line of code needs to execute extremely fast and not tie up the CPU for any significant amount of time. A slightly more technical way of stating this is to say that all the function calls inside the cooperative multitasking framework need to be non-blocking, as opposed to blocking.

A non-blocking function will always do its best to return immediately, and the time it takes for it to return is going to be predictable and very short. Nothing inside a non-blocking function needs to wait for something else. The blink_task() function in the last example is a good sample of a non-blocking function. Nothing in it needs to wait, and we can be confident that the function returns virtually immediately.

In contrast, a blocking function will start a process that can take an (unpredictable) amount of time. Examples of this are using the delay() function or waiting to receive a certain number...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Practical Arduino Robotics
Published in: Mar 2023Publisher: PacktISBN-13: 9781804613177

Author (1)

author image
Lukas Kaul

Lukas Kaul is a robotics Research Scientist, currently working at the Toyota Research Institute in Silicon Valley, where he develops mobile manipulation technologies to support people in their homes and in their workplace. Throughout his career he has worked on projects as diverse as humanoid robots, aerial robots and mobile manipulation systems. A maker at heart, Lukas has been using Arduino technology extensively for more than a decade in countless side-projects, ranging from mapping systems to self-balancing robots. Lukas is passionate about teaching robotics with Arduino to inspire and empower anyone who wants to enter the exciting field of robotics. He holds a PhD degree from the Karlsruhe Institute of Technology, Germany.
Read more about Lukas Kaul