Module: BubbleWrap::Motion
- Defined in:
- motion/motion/motion.rb,
motion/motion/motion.rb,
motion/motion/gyroscope.rb,
motion/motion/magnetometer.rb,
motion/motion/accelerometer.rb,
motion/motion/device_motion.rb
Overview
These module methods provide the main interface. It uses a shared manager (per Apple’s recommendation), and they all have a common set of supported methods:
available?
active?
repeat(opts)
once(opts)
every(time_interval, opts)
If you insist on using your own manager, or you want more than one BW::Motion::Whatever running at the same time, you’ll need to instantiate them yourself.
Defined Under Namespace
Modules: Error
Classes: Accelerometer, DeviceMotion, GenericMotionInterface, Gyroscope, Magnetometer
Class Method Summary
collapse
Class Method Details
.accelerometer ⇒ Object
37
38
39
|
# File 'motion/motion/motion.rb', line 37
def accelerometer
@accelerometer ||= Accelerometer.new(self.manager)
end
|
.device ⇒ Object
49
50
51
|
# File 'motion/motion/motion.rb', line 49
def device
@device ||= DeviceMotion.new(self.manager)
end
|
.gyroscope ⇒ Object
41
42
43
|
# File 'motion/motion/motion.rb', line 41
def gyroscope
@gyroscope ||= Gyroscope.new(self.manager)
end
|
.magnetometer ⇒ Object
45
46
47
|
# File 'motion/motion/motion.rb', line 45
def magnetometer
@magnetometer ||= Magnetometer.new(self.manager)
end
|
.manager ⇒ Object
33
34
35
|
# File 'motion/motion/motion.rb', line 33
def manager
@manager ||= CMMotionManager.alloc.init
end
|