dumbvfd 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/dumbvfd.rb +31 -0
  3. metadata +59 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 848c668409a7acfb9a28bf170c376d10ac52f5b0
4
+ data.tar.gz: 37d235503cbd8973c42005005dbc3bf6a24092e4
5
+ SHA512:
6
+ metadata.gz: 8350b40b363e539206fd10506daeacae1cf209a72c516f5ca5b59bb6ebc1c7c2f731d67c46753d3c8edbd5e5c108ca67c4b23455b67e319c2b0999a8e463427b
7
+ data.tar.gz: ab3a481cdd63015dde343aa80c47bc2bd4d818eeb3f5f4b3a370e475488d666ea1ba0b6ad58064540b67d77c529f33fa77f594d856490c46d36839167182d1a9
data/lib/dumbvfd.rb ADDED
@@ -0,0 +1,31 @@
1
+ require 'rubygems'
2
+ require 'serialport'
3
+
4
+ class Vfd
5
+ def initialize(port)
6
+ @port = port
7
+ end
8
+
9
+ def connect()
10
+ $serial = SerialPort.new("#{@port}", 9600)
11
+ #$serial.read_timeout = 4000
12
+ end
13
+
14
+ def display(data)
15
+ lan = data.length
16
+ if lan < 20 then
17
+ $serial.write("#{data.center(20)}")
18
+ else
19
+ $serial.write("#{data[0...19].center(19)}") #this will chop off all characters after the first 20. IE: For two lines, you need two writes.
20
+ end
21
+ end
22
+
23
+ def clear_screen
24
+ $serial.write("\x0\x0a\x0\x0d")
25
+ end
26
+
27
+ def close
28
+ $serial.close
29
+ end
30
+
31
+ end
metadata ADDED
@@ -0,0 +1,59 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dumbvfd
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Harold Giddings/KR0SIV
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-09-09 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: serialport
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description: This gem allows uses a serial port communicate with dumb terminal hardware.
28
+ Such as a VFD Pole Display.
29
+ email:
30
+ - harold@giddings.me
31
+ executables: []
32
+ extensions: []
33
+ extra_rdoc_files: []
34
+ files:
35
+ - lib/dumbvfd.rb
36
+ homepage: https://github.com/KR0SIV
37
+ licenses: []
38
+ metadata: {}
39
+ post_install_message:
40
+ rdoc_options: []
41
+ require_paths:
42
+ - lib
43
+ required_ruby_version: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ required_rubygems_version: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: '0'
53
+ requirements: []
54
+ rubyforge_project:
55
+ rubygems_version: 2.0.14
56
+ signing_key:
57
+ specification_version: 4
58
+ summary: VFD Dumb Terminal Interface
59
+ test_files: []