denko-piboard 0.14.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2c16debfc8c34bd8bcca26bc7bfacb260b807d795a36be181c2b9216d8c65da8
4
- data.tar.gz: 06d80503b03ba7cc4dea13f1737d822ad8b1c8546db57da6a8dad9708232f6c6
3
+ metadata.gz: 1e8e869c561c0673bcd8cafbef836a7e0c8fddb369a0b97a0c60a67a99380faf
4
+ data.tar.gz: 7f84e27065a552ad844c0483c8a5ff23e05fd7a4c2a7a8c5be2c92e99bfe9862
5
5
  SHA512:
6
- metadata.gz: 4f374de73471722936aebb24831c8bc02f7eace99ca8874ab5a6675554bb593a8b6d79b1617e80dca08e263a60858627214665dfb65f973cda19e4cb3d55a403
7
- data.tar.gz: c1584302567d48e2f02dac57870b85cd113c8c60ce547853a83fd7945550c2aa67f095ceee1fa3987d168ac05a9456b74fca8565448a6ef61b77d9a05804e0ed
6
+ metadata.gz: aa4600cdd0cd83070610255636ae318a4a3eff654fc7fce96097558a0d4bd673b30a6e206aadba7f26010a17e1aa3615b11d1f3735a4aef2096024bc9409d687
7
+ data.tar.gz: d9d8d876321f87d4bc47c91913e91159d094a7558353750f16afce38fabe6b5ff50c620cb571c588c715af9dba6f7d469fcc9c665427d488f3f11e85c55c8792
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in denko.gemspec
4
+ gemspec
data/README.md CHANGED
@@ -74,12 +74,13 @@ In theory, this should work on any SBC, running Linux, with drivers for the rele
74
74
  | BCM2711 | :green_heart: | Raspberry Pi 4, Raspberry Pi 400 | Raspberry Pi OS
75
75
  | BCM2710A1 | :green_heart: | Raspberry Pi Zero 2W | Raspberry Pi OS
76
76
  | BCM2712 | :question: | Raspberry Pi 5 |
77
+ | AML-S905X-CC | :green_heart: | Libre Computer Le Potato | Libre Computer Debian 12
77
78
 
78
79
  #### Software
79
80
 
80
81
  - Operating Systems:
81
82
  - DietPi (Bookworm)
82
- - Amrbian (Bookworm)
83
+ - Armbian (Bookworm)
83
84
  - Raspberry Pi OS (Bookworm)
84
85
 
85
86
  - Rubies:
@@ -131,7 +132,7 @@ overlays=i2c1-pi spidev1_0
131
132
 
132
133
  ### Radxa Zero3W/E
133
134
  - For Armbian OS specifically. Newer and performs better than latest Radxa OS or DietPi available.
134
- - Unfortunately, Armbian does not package all device tree overlays for the RK3566. I built binaries for this default config, on kernel `6.6.31-current-sunxi64`, and made them available [here](https://github.com/vickash/linux-sbc-overlays/tree/master/radxa/rockchip). To use, download the `.dtbo` files into `/boot/dtb/rockchip/overlay` on your Zero3. Make sure your kernel version matches.
135
+ - Unfortunately, Armbian does not package all device tree overlays for the RK3566. I built binaries for this default config, on kernel `6.1.75-vendor-rk35xx`, and made them available [here](https://github.com/vickash/linux-sbc-overlays/tree/master/radxa/rockchip). To use, download the `.dtbo` files into `/boot/dtb/rockchip/overlay` on your Zero3. Make sure your kernel version matches.
135
136
 
136
137
  If you rather build the overlays yourself, that repo contains the script too. On the Zero3:
137
138
  ```console
@@ -167,6 +168,32 @@ dtparam=i2c_arm_baudrate=400000
167
168
  dtoverlay=spi0-1cs
168
169
  ```
169
170
 
171
+ ### Raspberry Pi 5
172
+ - Instructions are same as Pi <= 4, but use the [Pi 5 map](board_maps/raspberry_pi5.yml) instead.
173
+ - NOTE: This is based on Raspberry Pi docs, but untested in hardware. If you notice anything that should be fixed, please open a PR.
174
+
175
+ ### Libre Computer Le Potato
176
+ - Use [Libre Computer Debian 12](https://distro.libre.computer/ci/debian/12/debian-12-base-arm64%2Baml-s905x-cc.img.xz)
177
+ - Save the [default map](board_maps/le_potato.yml) as `~/.denko_piboard_map.yml` on your Le Potato.
178
+ - Fix invalid signatures for apt:
179
+ ```console
180
+ wget https://deb.libre.computer/repo/pool/main/libr/libretech-keyring/libretech-keyring_2024.05.19_all.deb
181
+ sudo dpkg -i libretech-keyring_2024.05.19_all.deb
182
+ sudo apt update
183
+ ```
184
+ - Install the Libre Computer Wiring Tool:
185
+ ```console
186
+ sudo apt install libretech-gpio libretech-dtoverlay
187
+ ```
188
+ - Enable the default overlays for PWM, I2C and SPI:
189
+ ```console
190
+ # 1 PWM on GPIO 95
191
+ # 1 I2C (/dev/i2c-0) on GPIO 4 (SCL) and GPIO 5 (SDA)
192
+ # 1 SPI (/dev/spidev0.0) on GPIO 90 (CLK), GPIO 87 (MOSI), GPIO 88 (MISO), GPIO 98 (CS)
193
+ sudo ldto merge pwm-e i2c-ao spicc spicc-spidev
194
+ ```
195
+ - Reboot to enable overlays
196
+
170
197
  ## Get Permissions
171
198
  By default, only the Linux `root` user can use GPIO / I2C / SPI / PWM. If you have a default board map at `~/.denko_piboard_map.yml`, save [this script](scripts/set_permissions.rb) to your SBC, then run it:
172
199
 
data/board_maps/README.md CHANGED
@@ -53,7 +53,7 @@ This information enables denko-piboard to:
53
53
  - Refer to I2C and SPI by their Linux device indices
54
54
  - Raise errors if you try to use any reserved pin. This fails silently otherwise, which is confusing.
55
55
 
56
- There are pre-made maps for some boards [here](board_maps), which can be followed as templates. In general, these enable:
56
+ There are pre-made maps for some boards [here](./), which can be followed as templates. In general, these enable:
57
57
  - 2 PWM pins
58
58
  - 1 I2C interface (on physical pins 3,5 when possible)
59
59
  - 1 SPI interface (on physical pins 19,21,23 when possible)
@@ -0,0 +1,89 @@
1
+ #
2
+ # Tested on:
3
+ # - Libre Computer Le Potato AML-S905X-CC, using Libre Computing's official Debian 12 (2024-01-25), with kernel 6.1.92-15907-gf36fd2695db3
4
+ #
5
+ # Based on https://docs.google.com/spreadsheets/d/1U3z0Gb8HUEfCIMkvqzmhMpJfzRqjPXq7mFLC-hvbKlE
6
+ # Uses "Linux" GPIO numbers from that table
7
+ #
8
+ ---
9
+ pins:
10
+ # Left side (odd numbered physical pins)
11
+ # PIN 1 is 3V3
12
+ 5: { phy: 3, chip: 0, line: 5 }
13
+ 4: { phy: 5, chip: 0, line: 4 }
14
+ 98: { phy: 7, chip: 1, line: 98 }
15
+ # PIN 9 is GND
16
+ 8: { phy: 11, chip: 0, line: 8 }
17
+ 9: { phy: 13, chip: 0, line: 9 }
18
+ 10: { phy: 15, chip: 0, line: 10 }
19
+ # PIN 17 is 3V3
20
+ 87: { phy: 19, chip: 1, line: 87 }
21
+ 88: { phy: 21, chip: 1, line: 88 }
22
+ 90: { phy: 23, chip: 1, line: 90 }
23
+ # PIN 25 is GND
24
+ 75: { phy: 27, chip: 1, line: 75 }
25
+ 96: { phy: 29, chip: 1, line: 96 }
26
+ 97: { phy: 31, chip: 1, line: 97 }
27
+ 85: { phy: 33, chip: 1, line: 85 }
28
+ 86: { phy: 35, chip: 1, line: 86 }
29
+ 84: { phy: 37, chip: 1, line: 84 }
30
+ # PIN 39 is GND
31
+
32
+ # Right side (even numbered physical pins)
33
+ # PIN 2 is 5V
34
+ # PIN 4 is 5V
35
+ # PIN 6 is GND
36
+ 91: { phy: 8, chip: 1, line: 91 }
37
+ 92: { phy: 10, chip: 1, line: 92 }
38
+ 6: { phy: 12, chip: 0, line: 6 }
39
+ # PIN 14 is GND
40
+ 93: { phy: 16, chip: 1, line: 93 }
41
+ 94: { phy: 18, chip: 1, line: 94 }
42
+ # PIN 20 is GND
43
+ 79: { phy: 22, chip: 1, line: 79 }
44
+ 89: { phy: 24, chip: 1, line: 89 }
45
+ 80: { phy: 26, chip: 1, line: 80 }
46
+ 76: { phy: 28, chip: 1, line: 76 }
47
+ # PIN 30 is GND
48
+ 95: { phy: 32, chip: 1, line: 95 }
49
+ # PIN 34 is GND
50
+ 81: { phy: 36, chip: 1, line: 81 }
51
+ 82: { phy: 38, chip: 1, line: 82 }
52
+ 83: { phy: 40, chip: 1, line: 83 }
53
+
54
+ pwms:
55
+ # Overlay: pwm-e
56
+ # Enable on boot: sudo ldto merge pwm-e
57
+ # Device: /sys/class/pwm/pwmchip0/pwm0
58
+ #
59
+ 95:
60
+ pwmchip: 0
61
+ channel: 0
62
+
63
+ i2cs:
64
+ # Overlay: i2c-ao
65
+ # Enable on boot: sudo ldto merge i2c-ao
66
+ # Device: /dev/i2c-0
67
+ #
68
+ 0:
69
+ scl: 4
70
+ sda: 5
71
+
72
+ # Overlay: i2c-b
73
+ # Enable on boot: sudo ldto merge i2c-b
74
+ # Device: /dev/i2c-0 (if enabled alone), /dev/i2c-1 (if enabled with i2c-ao)
75
+ #
76
+ # 1:
77
+ # scl: 76
78
+ # sda: 75
79
+
80
+ spis:
81
+ # Overlays: spicc, spicc-spidev
82
+ # Enable on boot: sudo ldto merge spicc spicc-spidev
83
+ # Device: /dev/spidev0.0
84
+ #
85
+ 0:
86
+ clk: 90
87
+ mosi: 87
88
+ miso: 88
89
+ cs0: 89
@@ -80,8 +80,8 @@ spis:
80
80
  clk: 11
81
81
  mosi: 10
82
82
  miso: 9
83
- cs0: 8
84
- # cs1: 7
83
+ # cs0: 8 # only if using dtoverlay=spi0-1cs or dtoverlay=spi0-2cs
84
+ # cs1: 7 # only if using dtoverlay=spi0-2cs
85
85
 
86
86
  #
87
87
  # To enable in /boot/config.txt:
@@ -91,5 +91,5 @@ spis:
91
91
  # mosi: 20
92
92
  # miso: 19
93
93
  # cs0: 18
94
- ## cs1: 17
95
- ## cs2: 16
94
+ # cs1: 17 # only if using dtoverlay=spi1-2cs or dtoverlay=spi1-3cs
95
+ # cs2: 16 # only if using dtoverlay=spi1-3cs
@@ -0,0 +1,95 @@
1
+ #
2
+ # This is based on Rasperry Pi documentation, but UNTESTED in hardware.
3
+ # It should work for the Raspberry Pi 5.
4
+ # - GPIO line numbers are same as older Pis, but the gpiochip has changed from 0 to 4.
5
+ # - dtparam/dtoverlay for PWM, I2C and SPI are all unchanged, based on info from:
6
+ # https://github.com/raspberrypi/firmware/blob/master/boot/overlays/README
7
+ # - Expected to work on current Raspberry Pi OS.
8
+ #
9
+ ---
10
+ pins:
11
+ # Left side (odd numbered physical pins)
12
+ # PIN 1 is 3V3
13
+ 2: { phy: 3, chip: 4, line: 2 }
14
+ 3: { phy: 5, chip: 4, line: 3 }
15
+ 4: { phy: 7, chip: 4, line: 4 }
16
+ # PIN 9 is GND
17
+ 17: { phy: 11, chip: 4, line: 17 }
18
+ 27: { phy: 13, chip: 4, line: 27 }
19
+ 22: { phy: 15, chip: 4, line: 22 }
20
+ # PIN 17 is 3V3
21
+ 10: { phy: 19, chip: 4, line: 10 }
22
+ 9: { phy: 21, chip: 4, line: 9 }
23
+ 11: { phy: 23, chip: 4, line: 11 }
24
+ # PIN 25 is GND
25
+ 0: { phy: 27, chip: 4, line: 0 }
26
+ 5: { phy: 29, chip: 4, line: 5 }
27
+ 6: { phy: 31, chip: 4, line: 6 }
28
+ 13: { phy: 33, chip: 4, line: 13 }
29
+ 19: { phy: 35, chip: 4, line: 19 }
30
+ 26: { phy: 37, chip: 4, line: 26 }
31
+ # PIN 39 is GND
32
+
33
+ # Right side (even numbered physical pins)
34
+ # PIN 2 is 5V
35
+ # PIN 4 is 5V
36
+ # PIN 6 is GND
37
+ 14: { phy: 8, chip: 4, line: 14 }
38
+ 15: { phy: 10, chip: 4, line: 15 }
39
+ 18: { phy: 12, chip: 4, line: 18 }
40
+ # PIN 14 is GND
41
+ 23: { phy: 16, chip: 4, line: 23 }
42
+ 24: { phy: 18, chip: 4, line: 24 }
43
+ # PIN 20 is GND
44
+ 25: { phy: 22, chip: 4, line: 25 }
45
+ 8: { phy: 24, chip: 4, line: 8 }
46
+ 7: { phy: 6, chip: 4, line: 7 }
47
+ 1: { phy: 28, chip: 4, line: 1 }
48
+ # PIN 30 is GND
49
+ 12: { phy: 32, chip: 4, line: 12 }
50
+ # PIN 34 is GND
51
+ 16: { phy: 36, chip: 4, line: 16 }
52
+ 20: { phy: 38, chip: 4, line: 20 }
53
+ 21: { phy: 40, chip: 4, line: 21 }
54
+
55
+ pwms:
56
+ #
57
+ # To enable in /boot/config.txt:
58
+ # dtoverlay=pwm-2chan,pin=12,func=4,pin2=13,func2=4
59
+ 12:
60
+ pwmchip: 0
61
+ channel: 0
62
+ 13:
63
+ pwmchip: 0
64
+ channel: 1
65
+
66
+ i2cs:
67
+ #
68
+ # To enable in /boot/config.txt:
69
+ # dtparam=i2c_arm=on
70
+ # dtparam=i2c_arm_baudrate=400000
71
+ 1:
72
+ scl: 3
73
+ sda: 2
74
+
75
+ spis:
76
+ #
77
+ # To enable in /boot/config.txt:
78
+ # dtoverlay=spi0-0cs
79
+ 0:
80
+ clk: 11
81
+ mosi: 10
82
+ miso: 9
83
+ # cs0: 8 # only if using dtoverlay=spi0-1cs or dtoverlay=spi0-2cs
84
+ # cs1: 7 # only if using dtoverlay=spi0-2cs
85
+
86
+ #
87
+ # To enable in /boot/config.txt:
88
+ # dtoverlay=spi1-1cs
89
+ # 1:
90
+ # clk: 21
91
+ # mosi: 20
92
+ # miso: 19
93
+ # cs0: 18
94
+ # cs1: 17 # only if using dtoverlay=spi1-2cs or dtoverlay=spi1-3cs
95
+ # cs2: 16 # only if using dtoverlay=spi1-3cs
@@ -16,5 +16,5 @@ Gem::Specification.new do |s|
16
16
  s.required_ruby_version = '>=3'
17
17
 
18
18
  s.add_dependency 'lgpio', '~> 0.1'
19
- s.add_dependency 'denko', '~> 0.14'
19
+ s.add_dependency 'denko', '~> 0.15'
20
20
  end
@@ -27,16 +27,26 @@ oled = Denko::Display::SSD1306.new(bus: bus, rotate: true) # address: 0x3C is de
27
27
  # select: and dc: pins must be given. reset is optional (can be pulled high instead).
28
28
  # oled = Denko::Display::SSD1306.new(bus: bus, pins: {reset: 259, dc: 260, select: chip_select}, rotate: true)
29
29
 
30
+ # Transformation features in hardware.
31
+ # oled.reflect_x
32
+ # oled.reflect_y
33
+ oled.rotate
34
+
30
35
  # Draw some text on the OLED's canvas (a Ruby memory buffer).
31
36
  canvas = oled.canvas
32
- canvas.text_cursor = [27,60]
33
- canvas.print("Hello World!")
37
+ baseline = 42
38
+ canvas.text_cursor = 27, baseline+15
39
+ canvas.text "Hello World!"
34
40
 
35
41
  # Add some shapes to the canvas.
36
- baseline = 40
37
- canvas.rectangle(10, baseline, 30, -30)
38
- canvas.circle(66, baseline - 15, 15)
39
- canvas.triangle(87, baseline, 117, baseline, 102, baseline - 30)
42
+ canvas.rectangle x: 10, y: baseline, w: 30, h: -30
43
+ canvas.circle x: 66, y: baseline-15, r: 15
44
+ canvas.triangle x1: 87, y1: baseline,
45
+ x2: 117, y2: baseline,
46
+ x3: 102, y3: baseline-30
47
+
48
+ # 1px border to test screen edges.
49
+ canvas.rectangle x1: 0, y1: 0, x2: canvas.x_max, y2: canvas.y_max
40
50
 
41
51
  # Send the canvas to the OLED's graphics RAM so it shows.
42
52
  oled.draw
data/examples/led/fade.rb CHANGED
@@ -17,6 +17,6 @@ end
17
17
  values = (0..100).to_a + (1..99).to_a.reverse
18
18
 
19
19
  values.cycle do |v|
20
- led.write(v)
20
+ led.duty = v
21
21
  sleep 0.020
22
22
  end
data/lib/denko/piboard.rb CHANGED
@@ -8,7 +8,6 @@ require_relative 'piboard_pulse'
8
8
  require_relative 'piboard_tone'
9
9
 
10
10
  require_relative 'piboard_hardware_pwm'
11
- require_relative 'piboard_servo'
12
11
  require_relative 'piboard_infrared'
13
12
 
14
13
  require_relative 'piboard_i2c'
@@ -22,6 +22,10 @@ module Denko
22
22
  parse_map(map_yaml_file)
23
23
  end
24
24
 
25
+ def platform
26
+ :linux
27
+ end
28
+
25
29
  def finish_write
26
30
  gpio_handles.each { |h| LGPIO.chip_close(h) if h }
27
31
  end
@@ -73,11 +73,13 @@ module Denko
73
73
 
74
74
  def pwm_write(pin, duty)
75
75
  if hardware_pwms[pin]
76
- hardware_pwms[pin].duty_percent = duty
76
+ hardware_pwms[pin].duty = duty
77
77
  else
78
- frequency = pin_configs[pin][:frequency] || 1000
79
78
  handle, line = gpio_tuple(pin)
80
- LGPIO.tx_pwm(handle, line, frequency, duty, 0, 0)
79
+ frequency = pin_configs[pin][:frequency] || 1000
80
+ period = pin_configs[pin][:period] || 1_000_000
81
+ duty_percent = (duty.to_f / period) * 100
82
+ LGPIO.tx_pwm(handle, line, frequency, duty_percent, 0, 0)
81
83
  end
82
84
  end
83
85
 
@@ -1,5 +1,10 @@
1
1
  module Denko
2
2
  class PiBoard
3
+ # Check if a GPIO number is bound to a hardware PWM.
4
+ def pin_is_pwm?(pin)
5
+ map[:pwms][pin]
6
+ end
7
+
3
8
  def hardware_pwms
4
9
  @hardware_pwms ||= []
5
10
  end
@@ -128,5 +128,9 @@ module Denko
128
128
  def convert_pin(pin)
129
129
  pin.to_i if pin
130
130
  end
131
+
132
+ def pin_is_pwm?(pin)
133
+ map[:pwms][pin]
134
+ end
131
135
  end
132
136
  end
@@ -1,5 +1,9 @@
1
1
  module Denko
2
2
  class PiBoard
3
+ def spi_limit
4
+ 4096
5
+ end
6
+
3
7
  def spi_flags(mode)
4
8
  mode ||= 0
5
9
  raise ArgumentError, "invalid SPI mode #{mode}" unless (0..3).include? mode
@@ -1,5 +1,5 @@
1
1
  module Denko
2
2
  class PiBoard
3
- VERSION = '0.14.0'
3
+ VERSION = '0.15.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: denko-piboard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - vickash
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-10-12 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: lgpio
@@ -30,27 +29,30 @@ dependencies:
30
29
  requirements:
31
30
  - - "~>"
32
31
  - !ruby/object:Gem::Version
33
- version: '0.14'
32
+ version: '0.15'
34
33
  type: :runtime
35
34
  prerelease: false
36
35
  version_requirements: !ruby/object:Gem::Requirement
37
36
  requirements:
38
37
  - - "~>"
39
38
  - !ruby/object:Gem::Version
40
- version: '0.14'
39
+ version: '0.15'
41
40
  description: Use Linux single-board-computer GPIO, I2C, SPI and PWM in Ruby
42
41
  email: mail@vickash.com
43
42
  executables: []
44
43
  extensions: []
45
44
  extra_rdoc_files: []
46
45
  files:
46
+ - Gemfile
47
47
  - LICENSE
48
48
  - README.md
49
49
  - Rakefile
50
50
  - board_maps/README.md
51
+ - board_maps/le_potato.yml
51
52
  - board_maps/orange_pi_zero_2w.yml
52
53
  - board_maps/radxa_zero3.yml
53
54
  - board_maps/raspberry_pi.yml
55
+ - board_maps/raspberry_pi5.yml
54
56
  - denko_piboard.gemspec
55
57
  - examples/digital_io/bench_out.rb
56
58
  - examples/digital_io/rotary_encoder.rb
@@ -86,7 +88,6 @@ files:
86
88
  - lib/denko/piboard_map.rb
87
89
  - lib/denko/piboard_one_wire.rb
88
90
  - lib/denko/piboard_pulse.rb
89
- - lib/denko/piboard_servo.rb
90
91
  - lib/denko/piboard_spi.rb
91
92
  - lib/denko/piboard_spi_bb.rb
92
93
  - lib/denko/piboard_tone.rb
@@ -98,7 +99,6 @@ licenses:
98
99
  - MIT
99
100
  metadata:
100
101
  source_code_uri: https://github.com/denko-rb/denko-piboard
101
- post_install_message:
102
102
  rdoc_options: []
103
103
  require_paths:
104
104
  - lib
@@ -113,8 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
113
113
  - !ruby/object:Gem::Version
114
114
  version: '0'
115
115
  requirements: []
116
- rubygems_version: 3.5.20
117
- signing_key:
116
+ rubygems_version: 3.6.7
118
117
  specification_version: 4
119
118
  summary: Linux SBC GPIO in Ruby
120
119
  test_files: []
@@ -1,19 +0,0 @@
1
- module Denko
2
- class PiBoard
3
- # CMD = 10
4
- def servo_toggle(pin, value=:off, options={})
5
- pwm = hardware_pwm_from_pin(pin)
6
- if (value == :off)
7
- pwm.duty_cycle = 0
8
- pwm.disable
9
- elsif
10
- pwm.frequency = 50
11
- end
12
- end
13
-
14
- # CMD = 11
15
- def servo_write(pin, value=0)
16
- hardware_pwms[pin].duty_us = value
17
- end
18
- end
19
- end