Is there a way I could get accelerometer in Objective-C or ASOC?
Is this an iPhone or Mac OS X question?
If it is an iPhone question, please consider searching with Google first.
iPhone accelerometer objective-c has some nice results. Especially link 2 seems to be a good tutorial.
I’m guessing that, since you included ASOC as an option, this is a Mac question.
There is a nice software library called “smslib” at
http://www.suitable.com/tools/smslib.html
In addition to an objective-C library, it also includes a unix utility “smsutil” that you can use from ordinary AppleScript ” check out my use of it in the AppleScript applet “MacFlip” at
http://modbookish.lefora.com/2010/04/21/macflip-a-free-accelerometer-based-display-rotatio-3/