このプロジェクトは、Arduino、node.js、およびApplescriptを使用して構築されたMacリモートコントロールを示しています。 ユーザーは、Macのボリューム、iTunesプレイリストの再生、およびミュート機能を制御できます。
主要な機能:
ソフトウェア(node.jsサーバー):
node.jsサーバーは
ライブラリを使用してarduinoおよび
コードは、次の関数を定義します
:コマンドをiTunesに送信します(再生、停止)。johnny-five
child_process
const five = require('johnny-five'); const exec = require('child_process').exec; // ... (rest of the code remains largely the same, with minor stylistic changes) ...
askiTunes(command)
:現在のボリューム設定を取得します。setVolumeLevel(level)
toggleMute()
getVolumeLevels()
tell application "iTunes" to play playlist "Top 25 Most Played"
tell application "iTunes" to stop
set volume output volume [level]
set volume with/without output muted
get volume settings
テキストツースピーチ()
tell application "Calculator" to launch
npm install johnny-five serialport
node index.js
Arduino接続とStandardFirmataアップロードを確認します
以上がnode.jsとarduinoを使用してMacをリモート制御しますの詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。