# Dual BUTTON ユニット {docsify-ignore-all} *** :memo:**[概要](#概要)**      :octocat:**[サンプルコード](#サンプルコード)**      :electric_plug:**[回路図](#回路図)**      🛒**[購入リンク](https://www.aliexpress.com/item/M5Stack-Official-New-Mini-Dual-Button-Unit-Mini-with-GROVE-Port-Cable-Connector-Compatible-with-FIRE/32923126250.html)**      :clapper:**[関連動画](#関連動画)** ## 概要 **Dual BUTTON**ユニットは2つのボタンが搭載されたユニットです。ボタンが押されるとLを出力し、リリースされるとHを出力します。ボタンA(青色)はGPIO36、ボタンB(赤色)はGPIO26に接続されています。Grove Bポートで利用します。 **信号出力:** ## 特徴 - GROVEインターフェースサポート、[UIFlow](http://flow.m5stack.com)、[Arduino](http://www.arduino.cc)をサポート - LEGO 互換ホール ## パッケージ内容 - 1x Dual BUTTON ユニット - 1x Grove ケーブル ## アプリケーション - ゲームコントローラー - リモコンスイッチ ## 関連リンク - **[公式ビデオ](https://www.youtube.com/channel/UCozgFVglWYQXbvTmGyS739w)** - **[フォーラム](http://forum.m5stack.com/)** ## サンプルコード ### 1. Arduino IDE *完全ナソースコードは[こちら](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/DUAL_BUTTON/Arduino)。* ```arduino #include // declaration int cur_value_red = 0; int cur_value_blue = 0; // initialization M5.begin(); pinMode(26, INPUT);// Red Button Pin setting pinMode(36, INPUT);// Blue Button Pin setting // read data cur_value_red = digitalRead(26); cur_value_blue = digitalRead(36); M5.update(); ``` ### 2. UIFlow *完全なソースコードは[こちら](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/DUAL_BUTTON/UIFlow)。* ## 回路図 ### ピンマッピング
M5Core(GROVEインターフェースB)GPIO36GPIO265VGND
DUAL_BUTTON Unit青いボタンピン赤いボタンピン5VGND
## 関連動画 **DUAL BUTTON デモ - ゲームコントロール VARIOUS2**