Unit Step16は、16ポジションロータリーエンコーダの値、7セグメント表示の明るさ、RGBライティングを制御します。
| 項目 | 情報 |
|---|---|
| 製品名 | Unit Step16 |
| SKU | U198 |
| 主な機能 | 16ポジションロータリーエンコーダ、7セグメント表示、RGBライティング制御 |
| 通信インターフェース | I2C |
| デフォルトI2Cアドレス | 0x48 |
| ESPHomeコンポーネント | unit_step16(外部コンポーネント) |
| ESPHomeバージョン要件 | / |
External Componentsの設定を追加します。
external_components:
- source: github://m5stack/esphome-yaml/components
components: [unit_step16]
refresh: 0s
unit_step16:
id: my_step16
i2c_id: bsp_iic
address: 0x48
led_brightness: 50
led_enabled: true
rgb_brightness: 50
rgb_enabled: true
rgb_red: 0
rgb_green: 255
rgb_blue: 0 Hubコンポーネントでは、目盛りLEDとRGB LEDの初期状態、明るさ、色を設定できます。led_brightnessと rgb_brightnessの範囲は0~100、RGB 各チャンネルの範囲は0~255です。
Sensorコンポーネントを追加します。
sensor:
- platform: unit_step16
unit_step16_id: my_step16
name: "Encoder Value"
update_interval: 100ms デフォルトの更新間隔は60sです。リアルタイム操作では必要に応じてupdate_intervalを短くしてください。
Outputコンポーネントを追加します。
output:
- platform: unit_step16
id: led_brightness_output
unit_step16_id: my_step16
channel: led_brightness
- platform: unit_step16
id: rgb_brightness_output
unit_step16_id: my_step16
channel: rgb_brightness
- platform: unit_step16
id: rgb_red_output
unit_step16_id: my_step16
channel: rgb_red
- platform: unit_step16
id: rgb_green_output
unit_step16_id: my_step16
channel: rgb_green
- platform: unit_step16
id: rgb_blue_output
unit_step16_id: my_step16
channel: rgb_blue Lightコンポーネントを追加します。
light:
- platform: rgb
id: step16_rgb_light
name: "Step16 RGB Light"
red: rgb_red_output
green: rgb_green_output
blue: rgb_blue_output
restore_mode: ALWAYS_ON
default_transition_length: 0s
- platform: monochromatic
id: step16_led_display
name: "Step16 LED Display"
output: led_brightness_output
restore_mode: ALWAYS_ON
default_transition_length: 0s Numberコンポーネントを追加します。
number:
- platform: template
name: "RGB Brightness"
min_value: 0
max_value: 100
step: 1
optimistic: true
initial_value: 50
on_value:
then:
- output.set_level:
id: rgb_brightness_output
level: !lambda "return x / 100.0;" 完全な例には、Unit Step16 外部コンポーネント、I2Cバス、エンコーダSensor、ライティングOutput、明るさNumberの設定が含まれます。