time7segment 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/time7segment.rb +6 -3
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd590ba61ac0ca84caf4bc17241df795dc29e4cb
|
4
|
+
data.tar.gz: 5477ec0522ab0baf974a64bd00aab8b1f88aae14
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d0752e7120d9c78665d9956df046f37866a646bd5061def2041751f8f06cd53d111f51eb62cbdf72e496401d81eccfd599400443b6b72d16f8d05d36bcf12cf
|
7
|
+
data.tar.gz: 7f1a83d50a89b654081b372d7ff59a1388c62f481c6a371aee4ef8e24149b4170f60147d97bfe46f8cf3e761aca9b7ede13e2d7d553da80b57ba1415a023f220
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/time7segment.rb
CHANGED
@@ -13,10 +13,13 @@ require 'rpi'
|
|
13
13
|
# 7 seg pin: 11 7 4 2 1 10 5 3
|
14
14
|
# GPIO pin: 11 4 23 8 20 10 18 25
|
15
15
|
|
16
|
+
# Hex values used:
|
17
|
+
# https://en.wikipedia.org/wiki/Seven-segment_display#Displaying_letters
|
18
|
+
|
16
19
|
|
17
20
|
class Time7Segment
|
18
21
|
|
19
|
-
#
|
22
|
+
# d1 d2 d3 d4 a b c d e f g dp
|
20
23
|
def initialize(gpio_pins=%w(22 27 17 24 11 4 23 8 20 10 18 25),
|
21
24
|
refresh: 0.0025)
|
22
25
|
|
@@ -34,8 +37,8 @@ class Time7Segment
|
|
34
37
|
Time.now.strftime("%H%M").chars.each.with_index do |x,i|
|
35
38
|
|
36
39
|
display(x.to_i)
|
37
|
-
@digits[i].on
|
38
40
|
@segments[7].method( i == 1 ? :off : :on).call
|
41
|
+
@digits[i].on
|
39
42
|
sleep @refresh
|
40
43
|
@digits[i].off
|
41
44
|
|
@@ -59,4 +62,4 @@ end
|
|
59
62
|
|
60
63
|
if __FILE__ == $0 then
|
61
64
|
Time7Segment.new(*ARGV).start
|
62
|
-
end
|
65
|
+
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: time7segment
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -84,5 +84,5 @@ rubygems_version: 2.4.8
|
|
84
84
|
signing_key:
|
85
85
|
specification_version: 4
|
86
86
|
summary: Displays the time on a 4 digit 7 segment display connected to a Raspberry
|
87
|
-
Pi
|
87
|
+
Pi.
|
88
88
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|