Class: BubbleWrap::Motion::Gyroscope
Instance Method Summary
collapse
#every, #initialize, #once, #repeat
Instance Method Details
#active? ⇒ Boolean
40
41
42
|
# File 'motion/motion/gyroscope.rb', line 40
def active?
@manager.gyroActive?
end
|
#available? ⇒ Boolean
36
37
38
|
# File 'motion/motion/gyroscope.rb', line 36
def available?
@manager.gyroAvailable?
end
|
#data ⇒ Object
44
45
46
|
# File 'motion/motion/gyroscope.rb', line 44
def data
@manager.gyroData
end
|
#start(options = {}, &handler) ⇒ Object
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
# File 'motion/motion/gyroscope.rb', line 5
def start(options={}, &handler)
if options.key?(:interval)
@manager.gyroUpdateInterval = options[:interval]
end
if handler
queue = convert_queue(options[:queue])
@manager.startGyroUpdatesToQueue(queue, withHandler: internal_handler(handler))
else
@manager.startGyroUpdates
end
return self
end
|
#stop ⇒ Object
48
49
50
|
# File 'motion/motion/gyroscope.rb', line 48
def stop
@manager.stopGyroUpdates
end
|