wiimote_morsecode 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +3 -0
- data.tar.gz.sig +0 -0
- data/lib/wiimote_morsecode.rb +48 -0
- metadata +108 -0
- metadata.gz.sig +0 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: bda7b471f94b57bc0461b110c1e9602d0a03f07a
|
4
|
+
data.tar.gz: deeb33e1a36de8be366394b33f4c9081f1f1f282
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: cfde4d811bacfdd7ae6bb261483cacdeefd861306c3c5232c9568de1f6c942e78b7fdb5ff08b4fce7a71705f9950aaf907c6ed3ae430ee6421f3ba7ac6b8b8c7
|
7
|
+
data.tar.gz: b09161400cf067234eee9891f98a8a834b6e03069b4dc8c6dbd6ecdf60d1ec02a4fe3b4958a8bea6d6ca799eac918ef3b538478165d0175456a7d07550db98ea
|
checksums.yaml.gz.sig
ADDED
data.tar.gz.sig
ADDED
Binary file
|
@@ -0,0 +1,48 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# file: wiimote_morsecode.rb
|
4
|
+
|
5
|
+
require 'wiimote_sps'
|
6
|
+
require 'morsecode'
|
7
|
+
|
8
|
+
class WiimoteMorseCode < WiimoteSps
|
9
|
+
|
10
|
+
|
11
|
+
def initialize(device_id: 'wiimote', sps_address: nil, sps_port: 59000,
|
12
|
+
dash: :minus, dot: :plus)
|
13
|
+
|
14
|
+
super(device_id: device_id, sps_address: sps_address, sps_port: 59000)
|
15
|
+
|
16
|
+
@mc = ''
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
def on_btn_b_press(wm)
|
21
|
+
@mc[-1] == '4' ? @mc[-1] = '5' : @mc += '4'
|
22
|
+
end
|
23
|
+
|
24
|
+
def on_btn_a_press(wm)
|
25
|
+
notify MorseCode.new(@mc).to_s
|
26
|
+
@mc = ''
|
27
|
+
end
|
28
|
+
|
29
|
+
def on_btn_minus_press(wm)
|
30
|
+
@mc += '1'
|
31
|
+
end
|
32
|
+
|
33
|
+
def on_btn_plus_press(wm)
|
34
|
+
@mc += '2'
|
35
|
+
end
|
36
|
+
|
37
|
+
def on_btn_home_press(wm)
|
38
|
+
@mc = ''
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
|
43
|
+
if __FILE__ == $0 then
|
44
|
+
|
45
|
+
wm = WiimoteMorseCode.new sps_address: 'sps', dash: :minus, dot: :plus
|
46
|
+
wm.activate
|
47
|
+
|
48
|
+
end
|
metadata
ADDED
@@ -0,0 +1,108 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: wiimote_morsecode
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- James Robertson
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain:
|
11
|
+
- |
|
12
|
+
-----BEGIN CERTIFICATE-----
|
13
|
+
MIIDljCCAn6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZW1t
|
14
|
+
YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjESMBAGCgmSJomT
|
15
|
+
8ixkARkWAmV1MB4XDTE3MDIwNzE4MTkyOVoXDTE4MDIwNzE4MTkyOVowSDESMBAG
|
16
|
+
A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
|
17
|
+
EjAQBgoJkiaJk/IsZAEZFgJldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
|
18
|
+
ggEBAPPcJO24bWmcVX97XHHTpZPpa+Mx3zSTEp5Kr+Dp4ZmcEcG6rPE4EeT9hDSh
|
19
|
+
hvIBaqUAHXRVKMVa7JOBxNKJnWRB+vMslfMSkkF1hLOzRhkOqihFIbnF0vxroVHM
|
20
|
+
eqMehBfPaWUQBIra1BRaGnZGPyAIoa8373pGT/IZLK8JGAHRIIeJktqGqhMYrS4M
|
21
|
+
mAhPppchJOUKSYwYWunJScmq8+93lvzDHfdFsEhjpB5trzaOo5os4g/4ckFbaolX
|
22
|
+
DyajJO6n/qVAbgMLVI2gHLmpxyRNXJNX3JPO71yUels1vq/T/GMCv8MmMv5inMZ2
|
23
|
+
Naiqg/w9NtDLKYVg5kFcXqgGMW0CAwEAAaOBijCBhzAJBgNVHRMEAjAAMAsGA1Ud
|
24
|
+
DwQEAwIEsDAdBgNVHQ4EFgQUyfxJ2YBNlMV02hvni5V34WG/OjkwJgYDVR0RBB8w
|
25
|
+
HYEbZ2VtbWFzdGVyQGphbWVzcm9iZXJ0c29uLmV1MCYGA1UdEgQfMB2BG2dlbW1h
|
26
|
+
c3RlckBqYW1lc3JvYmVydHNvbi5ldTANBgkqhkiG9w0BAQUFAAOCAQEAJ5yKCknM
|
27
|
+
HsK0DDC6IqOOTGx0O611JoKrWM41eYj6sYyeeFGz3PXvo6mPmWoxhQChvfFtJIMq
|
28
|
+
m+g9p1YGVwu8oyUy/tX6/CPaCyjr82IcOXKDnlkNjN3CvmJXfiXZCSVQAi3kHZzQ
|
29
|
+
s6sqNoN4WWAKnYmwagUGMOEQP8WeGLBvNNsgkndaiJDro/4sP2pCmX4f8r5EycR+
|
30
|
+
JrC2BW67tq0yz0KaY7s7sqth5P7IP7YS+XaHRIkm1kz8fO9R2jNjplP3g7QBhTQO
|
31
|
+
Dyr+UoEXkz2MYFhkfFsDz2CzFZV6/EDyFJNlqXMTxV3N39FtyzwWyV35TCxDwwe5
|
32
|
+
FiY5SJRVFQwnwA==
|
33
|
+
-----END CERTIFICATE-----
|
34
|
+
date: 2017-02-07 00:00:00.000000000 Z
|
35
|
+
dependencies:
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: morsecode
|
38
|
+
requirement: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - "~>"
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '0.2'
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 0.2.1
|
46
|
+
type: :runtime
|
47
|
+
prerelease: false
|
48
|
+
version_requirements: !ruby/object:Gem::Requirement
|
49
|
+
requirements:
|
50
|
+
- - "~>"
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '0.2'
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: 0.2.1
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: wiimote_sps
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - "~>"
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0.3'
|
63
|
+
- - ">="
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: 0.3.0
|
66
|
+
type: :runtime
|
67
|
+
prerelease: false
|
68
|
+
version_requirements: !ruby/object:Gem::Requirement
|
69
|
+
requirements:
|
70
|
+
- - "~>"
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: '0.3'
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.3.0
|
76
|
+
description:
|
77
|
+
email: james@jamesrobertson.eu
|
78
|
+
executables: []
|
79
|
+
extensions: []
|
80
|
+
extra_rdoc_files: []
|
81
|
+
files:
|
82
|
+
- lib/wiimote_morsecode.rb
|
83
|
+
homepage: https://github.com/jrobertson/wiimote_morsecode
|
84
|
+
licenses:
|
85
|
+
- MIT
|
86
|
+
metadata: {}
|
87
|
+
post_install_message:
|
88
|
+
rdoc_options: []
|
89
|
+
require_paths:
|
90
|
+
- lib
|
91
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0'
|
96
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
97
|
+
requirements:
|
98
|
+
- - ">="
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: '0'
|
101
|
+
requirements: []
|
102
|
+
rubyforge_project:
|
103
|
+
rubygems_version: 2.6.8
|
104
|
+
signing_key:
|
105
|
+
specification_version: 4
|
106
|
+
summary: Uses a Wiimote to input morse code and publish the translated text to an
|
107
|
+
SPS broker.
|
108
|
+
test_files: []
|
metadata.gz.sig
ADDED
Binary file
|