Imagine a device full of sensors. Now, in case a sensor x detects something, something should happen. Meanwhile, in case something else is detected, like two sensors detects two different things, then, this device must behave differently.
From webdesign (so javascript) I learned about Events, for example (using jquery) $(".x").on("click", function(){}) or from angularjs $scope.watch("name_of_var", function()).
Is there any possibility to replicate this behaviour in C, without using complex libraries?
I would assume you’re owning an embedded system with access to interrupts or a major event loop in a separate thread, otherwise this isn’t possible..
A basic model for event handling is here: