![]() Let’s add more details to this analogy: the email you’re about to receive contains a special offer to get a discount on a given website – and this offer is available only for 2 minutes. You are learning how to use Arduino to build your own projects?Ĭheck out Arduino For Beginners and learn step by step. You can now check your email, and the delay between the reception and you reading the email is basically zero. As soon as the email has arrived, you will get a popup on your phone/computer saying that the email is here. For us humans, this means turning on notifications. The other possible way to do that is to use interrupts. At a human scale you see that it’s completely not worth it. At a given frequency, you’re polling the state of something to see if a new information arrived. When the email arrives, you’ll have up to 5 minutes delay before you read it. ![]() And second, this is relatively inefficient. First, you’ll spend all your time refreshing your mailbox and won’t do any productive thing in the meantime. But this is really not an ideal solution. The most basic solution is to frequently check your mailbox – let’s say, every 5 minutes – so you’re sure the maximum delay between the reception of the email, and you reading it, is 5 minutes. You don’t know when it will arrive, but you want to make sure you read it as soon as it arrives in your mailbox. Imagine you’re waiting for an important email. What is an Interrupt pin? A real life analogy Example 1 Interrupts parameters and returned value.Don’t use the Serial library inside interrupts. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |