This will compile the block for your Simulink installation. Go to the blocks folder with MATLAB and type mex arduino_interrupt.c. To use the library, unzip the file after downloading the submission. The focus here will be on how to use the interrupt block but comments about how it works is included to better understand it and in case someone would like to modify it or continue development. The robot can then choose to back off, turn or just stop for example. In the next section we will use it as an alert signal when a robot gets to close to something. Here we are going to use the interrupt to respond to an event that occurs when an object comes too close to the IR sensor. It can also be useful when the processor has to respond quickly to an event. Interrupts are useful in some cases as they can respond to particular hardware events without having code that constantly checks the status of an input, thus reducing the load on the processor. In this part we are going to add an Arduino block that can call an interrupt service routine (ISR) when triggered by one of Arduinos digital inputs. We also implemented a software model to use range measurements on the Arduino. In part one we built a model of the Sharp IR sensor and learned how it works.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |