Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
const DashButton = require('dash-button');
const {exec} = require('child_process');
const do1 = new DashButton("xx:xx:xx:xx:xx:xx"); //じゃがりこ
const re = new DashButton("xx:xx:xx:xx:xx:xx"); //パンテーン
const mi = new DashButton("xx:xx:xx:xx:xx:xx"); //ヘルシア
const fa = new DashButton("xx:xx:xx:xx:xx:xx"); //カロリーメイト
const so = new DashButton("xx:xx:xx:xx:xx:xx"); //エヴィアン
const ra = new DashButton("xx:xx:xx:xx:xx:xx"); //アマゾンベーシック
const si = new DashButton("xx:xx:xx:xx:xx:xx"); //シーブリーズ
const do2 = new DashButton("xx:xx:xx:xx:xx:xx"); //ラックス
do1.addListener(() => {
console.log("do");
exec(`afplay Audio/ド.mp3`);
});
re.addListener(() => {
console.log("re");
exec(`afplay Audio/レ.mp3`);
});
mi.addListener(() => {
console.log("mi");
exec(`afplay Audio/ミ.mp3`);
});
fa.addListener(() => {
console.log("fa");
exec(`afplay Audio/ファ.mp3`);
});
so.addListener(() => {
console.log("so");
exec(`afplay Audio/ソ.mp3`);
});
ra.addListener(() => {
console.log("ra");
exec(`afplay Audio/ラ.mp3`);
});
si.addListener(() => {
console.log("si");
exec(`afplay Audio/シ.mp3`);
});
do2.addListener(() => {
console.log("do2");
exec(`afplay Audio/ド2.mp3`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment