Build from Visual Studio Code
Install Visual Studio Code
- Install Visual Studio Code.
You need to pass the IoT Central and derived device key to your application.
Open a Terminal command prompt. If you are using Windows Subsystem for Linux then open a WSL command prompt.
Go to the Altairdocker/AltairHL_emulator folder
Run the following command to open the folder with VS Code.
code .
Install the following Visual Studio Code extensions:
- If using WSL, then install the Visual Studio Code Remote-WSL extension.
- Visual Studio Code CodeLLDB extension
- CMake Tools extension
- C/C++ extension
Open the .vscode/launch.json file in VS Code.
Update the [args] json property for the build configuration.
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>"],
Save the launch.json file.
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")
Select the GCC or Clang Kit.
Press F5 to compile and launch the Altair emulator.