Class: PiWire::PWMPin
- Defined in:
- lib/pi_wire/pwm_pin.rb,
ext/pi_wire/pi_wire_pwm_pin.c
Instance Attribute Summary
Attributes inherited from Pin
Instance Method Summary collapse
-
#initialize ⇒ PWMPin
constructor
A new instance of PWMPin.
- #write(rb_int) ⇒ Object (also: #<<)
Constructor Details
#initialize ⇒ PWMPin
3 4 5 6 |
# File 'lib/pi_wire/pwm_pin.rb', line 3 def initialize @number = 1 self.mode = PiWire::PWM_MODE end |
Instance Method Details
#write(rb_int) ⇒ Object Also known as: <<
3 4 5 6 |
# File 'ext/pi_wire/pi_wire_pwm_pin.c', line 3 static VALUE write(VALUE self, VALUE rb_int) { pwmWrite(pin_number(self), NUM2INT(rb_int)); return Qtrue; } |