الانتقال إلى المحتوى

Lesson 45: Two things at once

English

Do not wait, check the clock

  • delay(500) stops everything for half a second. The board cannot blink another LED or read a button while it waits.
  • millis() tells you how many milliseconds have passed since the board started. It keeps counting while your program runs.
  • Instead of waiting, ask again and again: "Is it time yet?"

Words for this lesson

Word Meaning
millis() milliseconds since the board started
unsigned long a whole number that can be very big and never negative
blocking code that waits, so nothing else can run
non-blocking code that checks and moves on at once

تسجيل الدخول أو إنشاء حساب

IGCSE, A-Level & AP