Class: Subduino::Parse::Analogic

Inherits:
Digital
  • Object
show all
Defined in:
lib/subduino/parse.rb

Direct Known Subclasses

Energy, Flow, Knob, Lux, Pressure, Temp

Instance Method Summary collapse

Methods inherited from Digital

#graph, #initialize, #name, #raw, #sparkline, #to_s, #type

Constructor Details

This class inherits a constructor from Subduino::Parse::Digital

Instance Method Details

#digital?Boolean

Returns:

  • (Boolean)


35
# File 'lib/subduino/parse.rb', line 35

def digital?; false;   end

#parseObject



36
# File 'lib/subduino/parse.rb', line 36

def parse; @v;    end

#ratioObject



37
38
39
40
# File 'lib/subduino/parse.rb', line 37

def ratio
  return 0 if @v.zero?
  @v * 100 / 1023
end