File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1
1
# mruby-esp32-mcpwm
2
2
3
- PWM library for mruby-esp32.
3
+ MCPWM library for mruby-esp32.
4
4
5
5
## Installation
6
6
@@ -16,14 +16,14 @@ Add the line below to your `build_config.rb`:
16
16
17
17
``` ruby
18
18
mcpwm = MCPWM .new (1 ) # GPIO pin = 1
19
- mcpwm.frequency(50 ) # set frequency(Hz) of PWM
20
- mcpwm.duty(10 ) # set duty(%) of PWM
19
+ mcpwm.frequency(50 ) # set frequency(Hz) of MCPWM
20
+ mcpwm.duty(10 ) # set duty(%) of MCPWM
21
21
# => drive with frequency=50Hz(Period=20_000us), duby=10%(Pulse Width=2000us)
22
22
23
23
mcpwm = MCPWM .new (1 , freq: 100 , duty: 40 )
24
24
# => drive with frequency=100Hz(Period=10_000us), duby=40%(Pulse Width=4000us)
25
25
26
- mcpwm = PWM .new (1 )
26
+ mcpwm = MCPWM .new (1 )
27
27
mcpwm.period_us(25_000 )
28
28
mcpwm.pulse_width_us(5_000 )
29
29
# => drive with frequency=40Hz(Period=25_000us), duby=20%(Pulse Width=5000us)
You can’t perform that action at this time.
0 commit comments