Changes between Version 1 and Version 2 of wiimote_connect.rb

Show
Ignore:
Timestamp:
04/02/07 09:42:06 (6 years ago)
Author:
Heavybell
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • wiimote_connect.rb

    v1 v2  
    99* My 'good enough for now' OSD system [optional] 
    1010 
    11 Code follows: 
    12  
    13  #!/usr/bin/ruby 
    14   
    15  while true 
    16          if ( m = /(..:..:..:..:..:..).*Nintendo RVL-CNT-01.*/.match %x["/usr/bin/hcitool" scan] ) 
    17   
    18                  # Remove these lines if you aren't using my hacky OSD system 
    19                  f = File::open('/tmp/osdd', 'w') 
    20                  f.write("Connected Wiimote: #{m[1]}\n") 
    21                  f.close 
    22                  # End OSD system bit 
    23   
    24                  system "/usr/local/bin/wminput #{m[1]}\n" 
    25   
    26                  # Remove these lines if you aren't using my hacky OSD system 
    27                  f = File::open('/tmp/osdd', 'w') 
    28                  f.write("Disconnected Wiimote: #{m[1]}\n") 
    29                  f.close 
    30                  # End OSD system bit 
    31          end 
    32  end 
     11The script itself, as well as a Gentoo init script to run it, is attached. You may need to edit them, especially if you don't have my OSD system or anything like it (which is quite likely since I have not uploaded it anywhere).