Skip to main content

Build from Visual Studio Code

Install Visual Studio Code

  1. Install Visual Studio Code.

You need to pass the IoT Central and derived device key to your application.

  1. Open a Terminal command prompt. If you are using Windows Subsystem for Linux then open a WSL command prompt.

  2. Go to the Altairdocker/AltairHL_emulator folder

  3. Run the following command to open the folder with VS Code.

    code .
  4. Install the following Visual Studio Code extensions:

  5. Open the .vscode/launch.json file in VS Code.

  6. Update the [args] json property for the build configuration.

  7. Add the following information.

    • DPS or IoT Central ID Scope.
    • Device ID.
    • Derived device key.
    • Network interface, eg wlan0, eth0, en1. Use the ifconfig command to determine your active network interface.

    "args": ["-s", "<YOUR_SCOPE_ID>", "-d", "<YOUR_DEVICE_ID>", "-k", "<YOUR_DERIVED_DEVICE_KEY>", "-n", "<YOUR_NETWORK_INTERFACE>", "-o", "<YOUR_OPEN_WEATHER_MAP_API_KEY>"],

  8. Save the launch.json file.

  9. If you are have a Raspberry Pi Sense HAT, then enable the Pi Sense HAT in the CMakeLists.txt file. Uncomment:

    # set(ALTAIR_FRONT_PI_SENSE_HAT TRUE "Enable Raspberry Pi Sense HAT")
  10. Select the GCC or Clang Kit.

  11. Press F5 to compile and launch the Altair emulator.