Back to ORPHE-CORE.js ORPHE-CORE.jsに戻る

Quick Start with VSCode

Get started by including ORPHE-CORE.js Javascript via CDN without the need for any build steps.

ビルドステップなしでCDN経由でORPHE-CORE.js Javascriptを含めることで、すぐに始めることができます。本格的な開発には、VSCodeを使って開発することをお勧めします。

  1. Create a new index.html file in your project root. 適当なディレクトリを作成して、その中に新しいindex.htmlファイルを作成します。index.htmlの中身は以下の通りです。
  2.             
                <!doctype html>
                <html lang="en">
                  <head>
                    <meta charset="utf-8">
                    <title>ORPHE CORE JS DEMO</title>
                  </head>
                  <body>
                    <h1>Hello, ORPHE!</h1>
                    <button onclick="connectOrphe()">connect</button>
                    <script src="https://cdn.jsdelivr.net/gh/Orphe-OSS/ORPHE-CORE.js/js/ORPHE-CORE.js"
                    crossorigin="anonymous"></script>
                    <script>
                    var ble = new Orphe(0);
                    window.onload = function () {
                      // ORPHE CORE Init
                      ble.setup();
                    }
                    async function connectOrphe() {
                      await ble.begin('STEP_ANALYSIS_AND_SENSOR_VALUES');
                      ble.setLED(1, 0);
                    }
                    </script>
                  </body>
                </html>
              
            
  3. Check the index.html on your browser via local live server, such as Live Server, php -S localhost:8000, etc. Then click connect button and connect ORPHE CORE Module (CR-2). You will see light emitting on your ORPHE CORE Module like a below video. ローカルライブサーバー(Live Serverやphp -S localhost:8000など)を使って、ブラウザでindex.htmlを開いてください。その後、connectボタンをクリックしてORPHE COREモジュール(CR-2/CR-3)を接続します。以下のビデオのように、ORPHE COREモジュールが点灯するのを確認できます。
  4. You can check running the test program on quick_start_with_vscode.html page, or VSCode like a below video quick_start_with_vscode.html ページでテストプログラムを実行するか、VSCodeで以下のビデオのように実行できます。

Play LIGHT example with VSCode

  1. Create a directory, test or something like that. 例えば、testというディレクトリを作成します。
  2. Open "test" directory with VSCode VSCodeで"test"ディレクトリを開きます。
  3. Open Terminal on VSCode VSCodeでターミナルを開きます。
  4. type "git clone https://github.com/Orphe-OSS/ORPHE-CORE.js.git" on the terminal. ターミナルに"git clone https://github.com/Orphe-OSS/ORPHE-CORE.js.git"と入力します。
    git clone https://github.com/Orphe-OSS/ORPHE-CORE.js.git
  5. Open ORPHE-CORE.js/examples/LIGHT/index.html via VSCode explorer. VSCodeのエクスプローラーからORPHE-CORE.js/examples/LIGHT/index.htmlを開きます。
  6. Install "live server" extension "live server"拡張機能をインストールします。
  7. Click "Go Live" button at the bottom of VSCode window VSCodeウィンドウの下部にある"Go Live"ボタンをクリックします。