File: tilt_nod.rb

package info (click to toggle)
libfreenect 1%3A0.5.3-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,156 kB
  • sloc: ansic: 7,417; cpp: 7,265; cs: 2,062; python: 992; ruby: 873; java: 730; xml: 49; sh: 27; makefile: 23
file content (28 lines) | stat: -rwxr-xr-x 421 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env ruby
#

$: << File.expand_path(File.join(File.dirname(__FILE__), "../lib"))

require 'freenect'

ctx = Freenect.init
unless ctx.num_devices() > 0
  STDERR.puts "No kinect device detected"
  exit 1
end

dev = ctx[0]
dev.set_led(:blink_red_yellow)

3.times do
  dev.set_tilt_degrees(15)
  sleep 2
  dev.set_tilt_degrees(-15)
  sleep 2
end
dev.set_tilt_degrees(0.0)

dev.set_led(:off)
dev.close
ctx.shutdown