{"id":3712,"date":"2020-06-08T15:55:52","date_gmt":"2020-06-08T13:55:52","guid":{"rendered":"https:\/\/home.et.utwente.nl\/slootenvanf\/?p=3712"},"modified":"2025-03-19T10:08:39","modified_gmt":"2025-03-19T09:08:39","slug":"countdown-timers-tasks-in-parallel","status":"publish","type":"post","link":"https:\/\/home.et.utwente.nl\/slootenvanf\/2020\/06\/08\/countdown-timers-tasks-in-parallel\/","title":{"rendered":"Countdown timers and executing tasks in parallel on an Arduino"},"content":{"rendered":"\n<p>Most examples in this article <a href=\"https:\/\/home.et.utwente.nl\/slootenvanf\/2019\/11\/15\/using-oled-display-with-arduino\/\" target=\"_blank\" rel=\"noreferrer noopener\">use an OLED display<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Countdown timer example<\/h2>\n\n\n\n<figure class=\"wp-block-image is-resized alignright\"><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"300\" src=\"https:\/\/home.et.utwente.nl\/slootenvanf\/wp-content\/uploads\/2020\/06\/10to0.gif\" alt=\"\" class=\"wp-image-3721\" style=\"width:203px;height:102px\"\/><\/figure>\n\n\n\n<p>In its simplest form, a countdown timer can be coded like this, using the <em>loop() f<\/em>or repetition (no for- or while-loop needed!):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>void loop() {\n  if (count&gt;=0) { \/\/ if counter not finished\n      sprintf(buf, \"%2d\", count);\n      display.draw2x2String(4,3,buf); \/\/ show the counter\n      count = count - 1; \/\/ decrease counter\n  }\n  delay(1000); \/\/ wait one second\n}<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image alignright size-full is-resized\"><a href=\"https:\/\/wokwi.com\/projects\/400302075605931009\"><img loading=\"lazy\" decoding=\"async\" width=\"280\" height=\"280\" src=\"https:\/\/home.et.utwente.nl\/slootenvanf\/wp-content\/uploads\/2024\/06\/image-2.png\" alt=\"\" class=\"wp-image-5419\" style=\"width:79px;height:auto\" srcset=\"https:\/\/home.et.utwente.nl\/slootenvanf\/wp-content\/uploads\/2024\/06\/image-2.png 280w, https:\/\/home.et.utwente.nl\/slootenvanf\/wp-content\/uploads\/2024\/06\/image-2-80x80.png 80w\" sizes=\"auto, (max-width: 280px) 100vw, 280px\" \/><\/a><\/figure>\n\n\n\n<p><a href=\"https:\/\/home.et.utwente.nl\/slootenvanf\/div\/arduino\/oled_display_countdown_start_button.ino\" target=\"_blank\" rel=\"noreferrer noopener\">Download the sketch: <code>oled_display_countdown_start_button.ino<\/code><\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/wokwi.com\/projects\/400302075605931009\">Full simulation including breadboard on Wokwi:<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/wokwi.com\/projects\/400302075605931009\"><img loading=\"lazy\" decoding=\"async\" width=\"1030\" height=\"545\" src=\"https:\/\/home.et.utwente.nl\/slootenvanf\/wp-content\/uploads\/2024\/06\/image-1-1030x545.png\" alt=\"\" class=\"wp-image-5412\" srcset=\"https:\/\/home.et.utwente.nl\/slootenvanf\/wp-content\/uploads\/2024\/06\/image-1-1030x545.png 1030w, https:\/\/home.et.utwente.nl\/slootenvanf\/wp-content\/uploads\/2024\/06\/image-1-300x159.png 300w, https:\/\/home.et.utwente.nl\/slootenvanf\/wp-content\/uploads\/2024\/06\/image-1-768x406.png 768w, https:\/\/home.et.utwente.nl\/slootenvanf\/wp-content\/uploads\/2024\/06\/image-1.png 1290w\" sizes=\"auto, (max-width: 1030px) 100vw, 1030px\" \/><\/a><\/figure>\n\n\n\n<p>This will countdown from 10 to 0 in ten seconds after the button is pressed. If you prefer to display the number as a time, like MM:SS, you can realize that as follows:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>int min = count\/60;\nint sec = count%60;\nsprintf(buf, \"%02d:%02d\", min, sec);\ndisplay.draw2x2String(2,3,buf);<\/code><\/pre>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/home.et.utwente.nl\/slootenvanf\/div\/arduino\/oled_display_countdown_start_button2.ino\" target=\"_blank\">Full example : <code>oled_display_countdown_start_button2.ino<\/code><\/a><\/p>\n\n\n\n<p>Both examples use a button to start the timer. This is realized by a waiting loop (a loop which does nothing, except for checking its condition) as the last line in <em>setup()<\/em>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>while(digitalRead(START_BTN)==HIGH) ;<\/code><\/pre>\n\n\n\n<p>Note the empty statement: &#8216;;&#8217; does nothing, thus waits for the button to be pressed (becomes LOW).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Another example: push-and-hold<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large is-resized alignright\"><a href=\"https:\/\/home.et.utwente.nl\/slootenvanf\/wp-content\/uploads\/2021\/06\/Gestures_Long_Press.png\"><img loading=\"lazy\" decoding=\"async\" width=\"833\" height=\"833\" src=\"https:\/\/home.et.utwente.nl\/slootenvanf\/wp-content\/uploads\/2021\/06\/Gestures_Long_Press.png\" alt=\"\" class=\"wp-image-4485\" style=\"width:176px;height:176px\" srcset=\"https:\/\/home.et.utwente.nl\/slootenvanf\/wp-content\/uploads\/2021\/06\/Gestures_Long_Press.png 833w, https:\/\/home.et.utwente.nl\/slootenvanf\/wp-content\/uploads\/2021\/06\/Gestures_Long_Press-300x300.png 300w, https:\/\/home.et.utwente.nl\/slootenvanf\/wp-content\/uploads\/2021\/06\/Gestures_Long_Press-150x150.png 150w, https:\/\/home.et.utwente.nl\/slootenvanf\/wp-content\/uploads\/2021\/06\/Gestures_Long_Press-768x768.png 768w, https:\/\/home.et.utwente.nl\/slootenvanf\/wp-content\/uploads\/2021\/06\/Gestures_Long_Press-100x100.png 100w\" sizes=\"auto, (max-width: 833px) 100vw, 833px\" \/><\/a><\/figure>\n\n\n\n<p>Start a sketch if button held for a period. If released prior to the period abort. Uses the <a href=\"https:\/\/www.arduino.cc\/reference\/en\/language\/functions\/time\/millis\/\" target=\"_blank\" rel=\"noreferrer noopener\">millis()<\/a> function to keep track of time (in milliseconds). <a href=\"https:\/\/www.norwegiancreations.com\/2017\/09\/arduino-tutorial-using-millis-instead-of-delay\/\" target=\"_blank\" rel=\"noreferrer noopener\">Learn why using delay() in cases like this is not useful.<\/a><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    if (millis() &gt;= time_start + period) { \/\/ holding period over?\n      display.clearLine(0);\n      display.drawString(0, 0, \"DONE\"); \/\/ time to hold the button for period succesfully done\n      status = 1;\n    }\n    else if (digitalRead(START_BTN) == HIGH) { \/\/ button released?\n      \/\/ abort, button was released\n      display.clearLine(0);\n      display.drawString(0, 0, \"ABORT\");\n      status = 2;\n    }<\/code><\/pre>\n\n\n\n<p>Download the example: <a href=\"http:\/\/home.et.utwente.nl\/slootenvanf\/div\/arduino\/oled_display_hold_button.ino\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>oled_display_hold_button.ino<\/strong><\/a> (<a href=\"https:\/\/wokwi.com\/projects\/400308301260275713\" target=\"_blank\" rel=\"noreferrer noopener\">Wokwi simulation here<\/a>)<\/p>\n\n\n\n<p>Another example: turn Arduino on or off by holding a button: <a href=\"http:\/\/home.et.utwente.nl\/slootenvanf\/div\/arduino\/button_on_off_long_press.ino\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>button_on_off_long_press.ino<\/strong><\/a> (<a href=\"https:\/\/wokwi.com\/projects\/400308728945108993\" target=\"_blank\" rel=\"noreferrer noopener\">Wokwi simulation here<\/a>)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Parallel tasks, advanced timer example<\/h2>\n\n\n\n<p>About running tasks in the background: it is true that the <em>loop()<\/em> is actually a kind of &#8216;single task&#8217; that does not allow (or is difficult) to run things in parallel or in the background.<br>However, because the Arduino is fairly fast, tasks that are performed in serial (one after the other) may still appear to the user as if they are being performed simultaneously.<br>It is important that you do not use delays, so that everything is executed as quickly as possible.<br>Instead of using delays, you can then keep the time and have things done at a certain time: eg. make an LED blink every 300ms and read all buttons at the same time (as quickly as possible).<br>The example below uses that: three tasks (in the loop) are performed in serial, but for the user it looks like they occur in parallel, because they do not contain any delays.<\/p>\n\n\n\n<figure class=\"wp-block-image alignright size-full is-resized\"><a href=\"https:\/\/wokwi.com\/projects\/400309204972451841\"><img loading=\"lazy\" decoding=\"async\" width=\"280\" height=\"280\" src=\"https:\/\/home.et.utwente.nl\/slootenvanf\/wp-content\/uploads\/2024\/06\/image-2.png\" alt=\"\" class=\"wp-image-5419\" style=\"width:79px;height:auto\" srcset=\"https:\/\/home.et.utwente.nl\/slootenvanf\/wp-content\/uploads\/2024\/06\/image-2.png 280w, https:\/\/home.et.utwente.nl\/slootenvanf\/wp-content\/uploads\/2024\/06\/image-2-80x80.png 80w\" sizes=\"auto, (max-width: 280px) 100vw, 280px\" \/><\/a><\/figure>\n\n\n\n<p>See the code:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/wokwi.com\/projects\/400309204972451841\" target=\"_blank\" rel=\"noreferrer noopener\">In Wokwi simulation<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/home.et.utwente.nl\/slootenvanf\/div\/arduino\/oled_display_countdown_start_button_set_timer.ino\" target=\"_blank\" rel=\"noreferrer noopener\">Download full sketch<\/a><\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>void loop() {\n  unsigned long currentMillis = millis();\n\n  \/\/ task 1 - blink time on display every 300ms when setting it:\n  if (currentMillis - previousMillis2 &gt; 300 ) { \/\/ 300ms passed?\n    previousMillis2 = currentMillis; \/\/ save the last time\n    blink = !blink;\n    \/\/ ... display blinking numbers when setting the time  ...\n  }\n\n  \/\/ task 2 - update countdown timer every second\n  if (currentMillis - previousMillis &gt; interval) { \/\/ interval passed?\n    previousMillis = currentMillis; \/\/ save the last time\n    \/\/ ... display changing countdown timer on the display ...\n  }\n\n  \/\/ task 3 - check for pressed buttons\n  for (int i = 0; i &lt; NUMBUTTONS; i++) {\n    \/\/ Update the Bounce instance :\n    buttons&#91;i].update();\n    if ( buttons&#91;i].fell() ) { \/\/ a button was pressed\n       \/\/ ... process actions for buttons ...\n    }\n  } \/\/ end for\n}<\/code><\/pre>\n\n\n\n<p>Here the time is kept with <a rel=\"noreferrer noopener\" href=\"https:\/\/www.arduino.cc\/reference\/en\/language\/functions\/time\/millis\/\" target=\"_blank\">millis()<\/a>.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Countdown timer on Arduino\" width=\"1290\" height=\"726\" src=\"https:\/\/www.youtube.com\/embed\/eDKBeUZpoys?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>The example above is of course somewhat limited but in terms of coding not too complex. It is a timer of which the time can be set using up\/down\/set buttons. It can be paused while running  and after it is finished, it can be start again.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">More examples:<\/h4>\n\n\n\n<p>Start sketch after first button is pressed, then display a counter that counts up until 20 and then finishes. While running, it also checks the buttons pressed.<br>So this example executes 3 tasks in parallel: 1) blinking text, 2) counter counting &amp; display it, 3) check buttons. Download example: <code><a href=\"https:\/\/home.et.utwente.nl\/slootenvanf\/div\/arduino\/oled_display_countdown_timer_and_check_buttons.ino\" target=\"_blank\" rel=\"noreferrer noopener\">oled_display_countdown_timer_and_check_buttons.ino<\/a><\/code> or view it as <a href=\"https:\/\/wokwi.com\/projects\/400310064664390657\" target=\"_blank\" rel=\"noreferrer noopener\">Wokwi simulation<\/a>.<\/p>\n\n\n\n<p>An example showing RGB color LED with alternating colors ask a start sequence to start a game using a button. <a href=\"https:\/\/wokwi.com\/projects\/400289660957329409\">Complete simulation with breadboard and code on Wokwi<\/a>:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/home.et.utwente.nl\/slootenvanf\/wp-content\/uploads\/2024\/06\/image.png\"><img loading=\"lazy\" decoding=\"async\" width=\"791\" height=\"301\" src=\"https:\/\/home.et.utwente.nl\/slootenvanf\/wp-content\/uploads\/2024\/06\/image.png\" alt=\"\" class=\"wp-image-5405\" srcset=\"https:\/\/home.et.utwente.nl\/slootenvanf\/wp-content\/uploads\/2024\/06\/image.png 791w, https:\/\/home.et.utwente.nl\/slootenvanf\/wp-content\/uploads\/2024\/06\/image-300x114.png 300w, https:\/\/home.et.utwente.nl\/slootenvanf\/wp-content\/uploads\/2024\/06\/image-768x292.png 768w\" sizes=\"auto, (max-width: 791px) 100vw, 791px\" \/><\/a><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">On\/off example<\/h4>\n\n\n\n<p>Use a button to execute a process: eg. process data\/read sensors. The button turns the processing on or off. An LED indicates the process: it blinks while processing is performed, and is off when nothing happens. <a href=\"https:\/\/roboticsbackend.com\/arduino-turn-led-on-and-off-with-button\/\" target=\"_blank\" rel=\"noreferrer noopener\">Based on this tutorial.<\/a><br>To ensure smooth operation, debouncing and timing is all done based on <em>millis()<\/em>, no delays used.<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/vanslooten\/Arduino_examples\/blob\/master\/on_off.ino\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" src=\"https:\/\/home.et.utwente.nl\/slootenvanf\/wp-content\/uploads\/2025\/03\/image-8.png\"> Download the on\/off example here.<\/a><\/p>\n\n\n\n<p>Besides this you can also <a href=\"https:\/\/www.instructables.com\/id\/Arduino-Timer-Interrupts\/\" target=\"_blank\" rel=\"noreferrer noopener\">use timers<\/a> and even <a href=\"https:\/\/create.arduino.cc\/projecthub\/reanimationxp\/how-to-multithread-an-arduino-protothreading-tutorial-dd2c37\" target=\"_blank\" rel=\"noreferrer noopener\">a form of multi-theading<\/a>. But that soon becomes complex \u2026<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Most examples in this article use an OLED display. Countdown timer example In its simplest form, a countdown timer can be coded like this, using the loop() for repetition (no for- or while-loop needed!): Download the sketch: oled_display_countdown_start_button.ino Full simulation including breadboard on Wokwi: This will countdown from 10 to 0 in ten seconds after [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3730,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","footnotes":""},"categories":[3],"tags":[94,553,473,552,475,509,476,472,474],"class_list":["post-3712","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-education","tag-arduino","tag-button","tag-countdown","tag-on-off","tag-parallel","tag-start","tag-task","tag-time","tag-timer"],"blocksy_meta":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Countdown timers and executing tasks in parallel on an Arduino - vanslooten.com<\/title>\n<meta name=\"description\" content=\"Countdown timers and executing tasks in parallel on an Arduino\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/home.et.utwente.nl\/slootenvanf\/2020\/06\/08\/countdown-timers-tasks-in-parallel\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Countdown timers and executing tasks in parallel on an Arduino - vanslooten.com\" \/>\n<meta property=\"og:description\" content=\"Countdown timers and executing tasks in parallel on an Arduino\" \/>\n<meta property=\"og:url\" content=\"https:\/\/home.et.utwente.nl\/slootenvanf\/2020\/06\/08\/countdown-timers-tasks-in-parallel\/\" \/>\n<meta property=\"og:site_name\" content=\"vanslooten.com\" \/>\n<meta property=\"article:published_time\" content=\"2020-06-08T13:55:52+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-03-19T09:08:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/home.et.utwente.nl\/slootenvanf\/wp-content\/uploads\/2020\/06\/10to.png\" \/>\n\t<meta property=\"og:image:width\" content=\"267\" \/>\n\t<meta property=\"og:image:height\" content=\"77\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Fjodor van Slooten\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@fjodorvs\" \/>\n<meta name=\"twitter:site\" content=\"@fjodorvs\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Fjodor van Slooten\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/home.et.utwente.nl\\\/slootenvanf\\\/2020\\\/06\\\/08\\\/countdown-timers-tasks-in-parallel\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/home.et.utwente.nl\\\/slootenvanf\\\/2020\\\/06\\\/08\\\/countdown-timers-tasks-in-parallel\\\/\"},\"author\":{\"name\":\"Fjodor van Slooten\",\"@id\":\"https:\\\/\\\/home.et.utwente.nl\\\/slootenvanf\\\/#\\\/schema\\\/person\\\/e62ff2d6beaa937dc9345a023eeb05dd\"},\"headline\":\"Countdown timers and executing tasks in parallel on an Arduino\",\"datePublished\":\"2020-06-08T13:55:52+00:00\",\"dateModified\":\"2025-03-19T09:08:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/home.et.utwente.nl\\\/slootenvanf\\\/2020\\\/06\\\/08\\\/countdown-timers-tasks-in-parallel\\\/\"},\"wordCount\":596,\"publisher\":{\"@id\":\"https:\\\/\\\/home.et.utwente.nl\\\/slootenvanf\\\/#\\\/schema\\\/person\\\/e62ff2d6beaa937dc9345a023eeb05dd\"},\"image\":{\"@id\":\"https:\\\/\\\/home.et.utwente.nl\\\/slootenvanf\\\/2020\\\/06\\\/08\\\/countdown-timers-tasks-in-parallel\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/home.et.utwente.nl\\\/slootenvanf\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/10to.png\",\"keywords\":[\"arduino\",\"button\",\"countdown\",\"on-off\",\"parallel\",\"start\",\"task\",\"time\",\"timer\"],\"articleSection\":[\"Education\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/home.et.utwente.nl\\\/slootenvanf\\\/2020\\\/06\\\/08\\\/countdown-timers-tasks-in-parallel\\\/\",\"url\":\"https:\\\/\\\/home.et.utwente.nl\\\/slootenvanf\\\/2020\\\/06\\\/08\\\/countdown-timers-tasks-in-parallel\\\/\",\"name\":\"Countdown timers and executing tasks in parallel on an Arduino - vanslooten.com\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/home.et.utwente.nl\\\/slootenvanf\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/home.et.utwente.nl\\\/slootenvanf\\\/2020\\\/06\\\/08\\\/countdown-timers-tasks-in-parallel\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/home.et.utwente.nl\\\/slootenvanf\\\/2020\\\/06\\\/08\\\/countdown-timers-tasks-in-parallel\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/home.et.utwente.nl\\\/slootenvanf\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/10to.png\",\"datePublished\":\"2020-06-08T13:55:52+00:00\",\"dateModified\":\"2025-03-19T09:08:39+00:00\",\"description\":\"Countdown timers and executing tasks in parallel on an Arduino\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/home.et.utwente.nl\\\/slootenvanf\\\/2020\\\/06\\\/08\\\/countdown-timers-tasks-in-parallel\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/home.et.utwente.nl\\\/slootenvanf\\\/2020\\\/06\\\/08\\\/countdown-timers-tasks-in-parallel\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/home.et.utwente.nl\\\/slootenvanf\\\/2020\\\/06\\\/08\\\/countdown-timers-tasks-in-parallel\\\/#primaryimage\",\"url\":\"https:\\\/\\\/home.et.utwente.nl\\\/slootenvanf\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/10to.png\",\"contentUrl\":\"https:\\\/\\\/home.et.utwente.nl\\\/slootenvanf\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/10to.png\",\"width\":267,\"height\":77},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/home.et.utwente.nl\\\/slootenvanf\\\/2020\\\/06\\\/08\\\/countdown-timers-tasks-in-parallel\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/home.et.utwente.nl\\\/slootenvanf\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Countdown timers and executing tasks in parallel on an Arduino\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/home.et.utwente.nl\\\/slootenvanf\\\/#website\",\"url\":\"https:\\\/\\\/home.et.utwente.nl\\\/slootenvanf\\\/\",\"name\":\"vanslooten.com\",\"description\":\"Personal website of Fjodor van Slooten\",\"publisher\":{\"@id\":\"https:\\\/\\\/home.et.utwente.nl\\\/slootenvanf\\\/#\\\/schema\\\/person\\\/e62ff2d6beaa937dc9345a023eeb05dd\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/home.et.utwente.nl\\\/slootenvanf\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/home.et.utwente.nl\\\/slootenvanf\\\/#\\\/schema\\\/person\\\/e62ff2d6beaa937dc9345a023eeb05dd\",\"name\":\"Fjodor van Slooten\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/home.et.utwente.nl\\\/slootenvanf\\\/wp-content\\\/uploads\\\/2019\\\/06\\\/2018-08-24-13.33.38_small.jpg\",\"url\":\"https:\\\/\\\/home.et.utwente.nl\\\/slootenvanf\\\/wp-content\\\/uploads\\\/2019\\\/06\\\/2018-08-24-13.33.38_small.jpg\",\"contentUrl\":\"https:\\\/\\\/home.et.utwente.nl\\\/slootenvanf\\\/wp-content\\\/uploads\\\/2019\\\/06\\\/2018-08-24-13.33.38_small.jpg\",\"width\":300,\"height\":214,\"caption\":\"Fjodor van Slooten\"},\"logo\":{\"@id\":\"https:\\\/\\\/home.et.utwente.nl\\\/slootenvanf\\\/wp-content\\\/uploads\\\/2019\\\/06\\\/2018-08-24-13.33.38_small.jpg\"},\"sameAs\":[\"http:\\\/\\\/vanslooten.com\",\"https:\\\/\\\/x.com\\\/fjodorvs\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Countdown timers and executing tasks in parallel on an Arduino - vanslooten.com","description":"Countdown timers and executing tasks in parallel on an Arduino","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/home.et.utwente.nl\/slootenvanf\/2020\/06\/08\/countdown-timers-tasks-in-parallel\/","og_locale":"en_US","og_type":"article","og_title":"Countdown timers and executing tasks in parallel on an Arduino - vanslooten.com","og_description":"Countdown timers and executing tasks in parallel on an Arduino","og_url":"https:\/\/home.et.utwente.nl\/slootenvanf\/2020\/06\/08\/countdown-timers-tasks-in-parallel\/","og_site_name":"vanslooten.com","article_published_time":"2020-06-08T13:55:52+00:00","article_modified_time":"2025-03-19T09:08:39+00:00","og_image":[{"width":267,"height":77,"url":"https:\/\/home.et.utwente.nl\/slootenvanf\/wp-content\/uploads\/2020\/06\/10to.png","type":"image\/png"}],"author":"Fjodor van Slooten","twitter_card":"summary_large_image","twitter_creator":"@fjodorvs","twitter_site":"@fjodorvs","twitter_misc":{"Written by":"Fjodor van Slooten","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/home.et.utwente.nl\/slootenvanf\/2020\/06\/08\/countdown-timers-tasks-in-parallel\/#article","isPartOf":{"@id":"https:\/\/home.et.utwente.nl\/slootenvanf\/2020\/06\/08\/countdown-timers-tasks-in-parallel\/"},"author":{"name":"Fjodor van Slooten","@id":"https:\/\/home.et.utwente.nl\/slootenvanf\/#\/schema\/person\/e62ff2d6beaa937dc9345a023eeb05dd"},"headline":"Countdown timers and executing tasks in parallel on an Arduino","datePublished":"2020-06-08T13:55:52+00:00","dateModified":"2025-03-19T09:08:39+00:00","mainEntityOfPage":{"@id":"https:\/\/home.et.utwente.nl\/slootenvanf\/2020\/06\/08\/countdown-timers-tasks-in-parallel\/"},"wordCount":596,"publisher":{"@id":"https:\/\/home.et.utwente.nl\/slootenvanf\/#\/schema\/person\/e62ff2d6beaa937dc9345a023eeb05dd"},"image":{"@id":"https:\/\/home.et.utwente.nl\/slootenvanf\/2020\/06\/08\/countdown-timers-tasks-in-parallel\/#primaryimage"},"thumbnailUrl":"https:\/\/home.et.utwente.nl\/slootenvanf\/wp-content\/uploads\/2020\/06\/10to.png","keywords":["arduino","button","countdown","on-off","parallel","start","task","time","timer"],"articleSection":["Education"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/home.et.utwente.nl\/slootenvanf\/2020\/06\/08\/countdown-timers-tasks-in-parallel\/","url":"https:\/\/home.et.utwente.nl\/slootenvanf\/2020\/06\/08\/countdown-timers-tasks-in-parallel\/","name":"Countdown timers and executing tasks in parallel on an Arduino - vanslooten.com","isPartOf":{"@id":"https:\/\/home.et.utwente.nl\/slootenvanf\/#website"},"primaryImageOfPage":{"@id":"https:\/\/home.et.utwente.nl\/slootenvanf\/2020\/06\/08\/countdown-timers-tasks-in-parallel\/#primaryimage"},"image":{"@id":"https:\/\/home.et.utwente.nl\/slootenvanf\/2020\/06\/08\/countdown-timers-tasks-in-parallel\/#primaryimage"},"thumbnailUrl":"https:\/\/home.et.utwente.nl\/slootenvanf\/wp-content\/uploads\/2020\/06\/10to.png","datePublished":"2020-06-08T13:55:52+00:00","dateModified":"2025-03-19T09:08:39+00:00","description":"Countdown timers and executing tasks in parallel on an Arduino","breadcrumb":{"@id":"https:\/\/home.et.utwente.nl\/slootenvanf\/2020\/06\/08\/countdown-timers-tasks-in-parallel\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/home.et.utwente.nl\/slootenvanf\/2020\/06\/08\/countdown-timers-tasks-in-parallel\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/home.et.utwente.nl\/slootenvanf\/2020\/06\/08\/countdown-timers-tasks-in-parallel\/#primaryimage","url":"https:\/\/home.et.utwente.nl\/slootenvanf\/wp-content\/uploads\/2020\/06\/10to.png","contentUrl":"https:\/\/home.et.utwente.nl\/slootenvanf\/wp-content\/uploads\/2020\/06\/10to.png","width":267,"height":77},{"@type":"BreadcrumbList","@id":"https:\/\/home.et.utwente.nl\/slootenvanf\/2020\/06\/08\/countdown-timers-tasks-in-parallel\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/home.et.utwente.nl\/slootenvanf\/"},{"@type":"ListItem","position":2,"name":"Countdown timers and executing tasks in parallel on an Arduino"}]},{"@type":"WebSite","@id":"https:\/\/home.et.utwente.nl\/slootenvanf\/#website","url":"https:\/\/home.et.utwente.nl\/slootenvanf\/","name":"vanslooten.com","description":"Personal website of Fjodor van Slooten","publisher":{"@id":"https:\/\/home.et.utwente.nl\/slootenvanf\/#\/schema\/person\/e62ff2d6beaa937dc9345a023eeb05dd"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/home.et.utwente.nl\/slootenvanf\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/home.et.utwente.nl\/slootenvanf\/#\/schema\/person\/e62ff2d6beaa937dc9345a023eeb05dd","name":"Fjodor van Slooten","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/home.et.utwente.nl\/slootenvanf\/wp-content\/uploads\/2019\/06\/2018-08-24-13.33.38_small.jpg","url":"https:\/\/home.et.utwente.nl\/slootenvanf\/wp-content\/uploads\/2019\/06\/2018-08-24-13.33.38_small.jpg","contentUrl":"https:\/\/home.et.utwente.nl\/slootenvanf\/wp-content\/uploads\/2019\/06\/2018-08-24-13.33.38_small.jpg","width":300,"height":214,"caption":"Fjodor van Slooten"},"logo":{"@id":"https:\/\/home.et.utwente.nl\/slootenvanf\/wp-content\/uploads\/2019\/06\/2018-08-24-13.33.38_small.jpg"},"sameAs":["http:\/\/vanslooten.com","https:\/\/x.com\/fjodorvs"]}]}},"_links":{"self":[{"href":"https:\/\/home.et.utwente.nl\/slootenvanf\/wp-json\/wp\/v2\/posts\/3712","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/home.et.utwente.nl\/slootenvanf\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/home.et.utwente.nl\/slootenvanf\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/home.et.utwente.nl\/slootenvanf\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/home.et.utwente.nl\/slootenvanf\/wp-json\/wp\/v2\/comments?post=3712"}],"version-history":[{"count":32,"href":"https:\/\/home.et.utwente.nl\/slootenvanf\/wp-json\/wp\/v2\/posts\/3712\/revisions"}],"predecessor-version":[{"id":5805,"href":"https:\/\/home.et.utwente.nl\/slootenvanf\/wp-json\/wp\/v2\/posts\/3712\/revisions\/5805"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/home.et.utwente.nl\/slootenvanf\/wp-json\/wp\/v2\/media\/3730"}],"wp:attachment":[{"href":"https:\/\/home.et.utwente.nl\/slootenvanf\/wp-json\/wp\/v2\/media?parent=3712"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/home.et.utwente.nl\/slootenvanf\/wp-json\/wp\/v2\/categories?post=3712"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/home.et.utwente.nl\/slootenvanf\/wp-json\/wp\/v2\/tags?post=3712"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}