Class: MAVLink::Log::Messages::ScaledPressure

Inherits:
TimedMessageMilli show all
Defined in:
lib/mavlink/log/messages/scaled_pressure.rb

Instance Method Summary collapse

Methods inherited from TimedMessageMilli

#time_boot_ms

Methods inherited from MAVLink::Log::Message

#crc, #id, #initialize

Constructor Details

This class inherits a constructor from MAVLink::Log::Message

Instance Method Details

#press_absObject

absolute pressure (hectopascal)



6
7
8
# File 'lib/mavlink/log/messages/scaled_pressure.rb', line 6

def press_abs
  @press_abs ||= float(4..7)
end

#press_diffObject

differential pressure (hectopascal)



11
12
13
# File 'lib/mavlink/log/messages/scaled_pressure.rb', line 11

def press_diff
  @press_diff ||= float(8..11)
end

#temperature(unit = :c) ⇒ Object

temperature ©



16
17
18
19
20
21
22
23
24
# File 'lib/mavlink/log/messages/scaled_pressure.rb', line 16

def temperature(unit = :c)
  @temperature ||= (int16_t(12..13) / 100.0)
  case unit
  when :f
    (@temperature * (9.0 / 5.0)) + 32
  else
    @temperature
  end
end