Class: Scale
Instance Attribute Summary collapse
-
#hi_in ⇒ Object
Returns the value of attribute hi_in.
-
#hi_out ⇒ Object
Returns the value of attribute hi_out.
-
#input ⇒ Object
Returns the value of attribute input.
-
#lo_in ⇒ Object
Returns the value of attribute lo_in.
-
#lo_out ⇒ Object
Returns the value of attribute lo_out.
Attributes inherited from Base
Instance Method Summary collapse
- #arduino_code ⇒ Object
- #cycle_level_arduino_code ⇒ Object
- #param_keys ⇒ Object
- #top_level_scope_code ⇒ Object
Methods inherited from Base
#add_arduino_code, #add_cycle_level_scope, #add_top_level_scope, #append_tsortable, #buildit, #depends_on, #initialize, #resolve_frame_optimized, #top_level_scope_arduino_code
Constructor Details
This class inherits a constructor from Base
Instance Attribute Details
#hi_in ⇒ Object
Returns the value of attribute hi_in.
14 15 16 |
# File 'lib/functions/scale.rb', line 14 def hi_in @hi_in end |
#hi_out ⇒ Object
Returns the value of attribute hi_out.
16 17 18 |
# File 'lib/functions/scale.rb', line 16 def hi_out @hi_out end |
#input ⇒ Object
Returns the value of attribute input.
12 13 14 |
# File 'lib/functions/scale.rb', line 12 def input @input end |
#lo_in ⇒ Object
Returns the value of attribute lo_in.
13 14 15 |
# File 'lib/functions/scale.rb', line 13 def lo_in @lo_in end |
#lo_out ⇒ Object
Returns the value of attribute lo_out.
15 16 17 |
# File 'lib/functions/scale.rb', line 15 def lo_out @lo_out end |
Instance Method Details
#arduino_code ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/functions/scale.rb', line 22 def arduino_code unless @frame_optimized [ "scale(#{@input.name}, #{@lo_in.name}, #{@hi_in.name}, #{@lo_out.name}, #{@hi_out.name}, #{@name});" ] else [] end end |
#cycle_level_arduino_code ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'lib/functions/scale.rb', line 32 def cycle_level_arduino_code if @frame_optimized [ "scale(#{@input.name}, #{@lo_in.name}, #{@hi_in.name}, #{@lo_out.name}, #{@hi_out.name}, #{@name});" ] else [] end end |
#param_keys ⇒ Object
18 19 20 |
# File 'lib/functions/scale.rb', line 18 def param_keys [:input, :lo_in, :hi_in, :lo_out, :hi_out] end |
#top_level_scope_code ⇒ Object
42 43 44 45 46 |
# File 'lib/functions/scale.rb', line 42 def top_level_scope_code [ "long #{@name}[3];" ] end |