Module: RubyToBlock::Block::HardwareOperation
- Extended by:
- ActiveSupport::Concern
- Included in:
- HardwareButtonPressedOrReleased, HardwareMotorDriverSetSpeed, HardwareSmalrubotAction, HardwareSmalrubotActionWithSec, HardwareSmalrubotDcMotorPowerRatio, HardwareSmalrubotDcMotorSetPowerRatio, HardwareSmalrubotLedTurnOnOrOff, HardwareSmalrubotSensorValue, HardwareTwoWheelDriveCarCommands, HardwareTwoWheelDriveCarSetSpeed, HardwareTwoWheelDriveCarSpeed
- Defined in:
- app/models/concerns/ruby_to_block/block/hardware_operation.rb
Overview
ハードウェアのメソッドや属性に共通するメソッドや定数を定義するモジュール
Constant Summary collapse
- SMALRUBOT_RE =
'(smalrubot_[^.]+)'- DIO_PIN_RE =
'\s*"(D(?:[2-9]|10|11|12|13))"\s*'- PWM_PIN_RE =
'\s*"(D(?:3|5|6|9|10|11))"\s*'- AIO_PIN_RE =
'\s*"(A[0-5])"\s*'- TWO_WHEEL_DRIVE_CAR_PIN_RE =
'\s*"(D[56])"\s*'- LOR_RE =
'(left|right)'- ON_OFF_RE =
'(turn_on|turn_off)'- POR_RE =
'(pressed|released)'- ACTION_RE =
'(forward|backward|turn_left|turn_right|stop)'
Instance Method Summary collapse
Instance Method Details
#type ⇒ Object
22 23 24 25 |
# File 'app/models/concerns/ruby_to_block/block/hardware_operation.rb', line 22 def type @type ||= (smalrubot_name ? super.gsub('smalrubot', smalrubot_name) : super) end |