O'Reilly logo

Programming the BeagleBone by Yogesh Chavan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Reading via interrupts

In our last program, we were checking if the button is pressed or not after each second. The button must remain pressed at the time of console printing to get it printed pressed. If you press the button quickly in between two printings, it will still print released. So in this situation, one button press event is lost. Consider another scenario. It is possible that nobody pressed the button for a long time. But still the program will wake up every 1 second and check for pin values. This is called polling. It wastes lots of CPU time and system resources on repetitive checking. This is not good programming practice. Polling prevents the CPU from going to sleep and saves power. This is not good for embedded systems where the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required