'Any sample code on getting data from sensors on Mac?

I am a newbie to Objective-C and this site, so can you point me in the right direction? I need sample code on ambient light sensor and sudden motion sensor on Mac. I really need this code and I didn't find anything on google. Can anyone help please?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source