spektrum-log 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/spektrum/log/records.rb +9 -1
- data/lib/spektrum/log/version.rb +1 -1
- data/spec/basic_data_record_spec.rb +4 -0
- metadata +1 -1
data/lib/spektrum/log/records.rb
CHANGED
@@ -68,8 +68,16 @@ module Spektrum
|
|
68
68
|
raw_voltage != 0xFFFF
|
69
69
|
end
|
70
70
|
|
71
|
-
def temperature
|
71
|
+
def temperature unit = :f
|
72
72
|
@temperature ||= two_byte_field(5..6)
|
73
|
+
case unit
|
74
|
+
when :f
|
75
|
+
@temperature
|
76
|
+
when :c
|
77
|
+
(@temperature - 32) * (5.0 / 9.0)
|
78
|
+
else
|
79
|
+
@temperature
|
80
|
+
end
|
73
81
|
end
|
74
82
|
|
75
83
|
def temperature?
|
data/lib/spektrum/log/version.rb
CHANGED