# Prerequisites

• You’ve already have Raspberry Pi 2B/2B+
• Raspbian has been installed on your Raspberry Pi
• Make sure your Raspberry Pi has Internet access

2. Configure the environment variables RUFF_HOME and PATH.
Note: The methods below will apply only to your current session. Please refer to Environment Variables Configuration for instructions on making the configuration permanent.

• Linux / OS X

Open the terminal and execute the following commands one by one, replacing /path/to/ruff-sdk with the path of your extracted SDK:

export RUFF_HOME=/path/to/ruff-sdk
export PATH=”$PATH:$RUFF_HOME/bin”

• Windows

Open cmd and execute the following commands one by one, replacing X:\path\to\ruff-sdk with the path of your extracted SDK:

set RUFF_HOME=X:\path\to\ruff-sdk
setx PATH “%PATH%;%RUFF_HOME%\bin”

3. Now execute rap --version in the command line. If the version of rap is printed as expected, PATH has been successfully configured.

Note: Ruff SDK contains two executable files: rap and ruff. rap is the development toolkit with features like device pairing, application initialization, and driver and module managing. ruff is the runtime of Ruff. The PC version of ruff targets testing and simulation.

2. Transmit ruffos-rpi-1.2.0.zip to your Raspberry Pi

4. Extract the package

5. Run installation script

6. Enable I2C on Raspberry Pi

Edit /boot/config.txt as follows and restart your Raspberry Pi.

# Uncomment some or all of these to enable the optional hardware interfaces
dtparam=i2c_arm=on

# Step 3: Creating a Project

1. Create a new project folder (e.g., hello-ruff). Change the directory to the created folder and use rap to initialize the application. Note: Create your new project folder outside of the Ruff SDK directory.

Raspberry Pi 2B is specified here as board argument for init task.

2. Fill in information as prompted. You can use default values for all fields. rap will initialize the project, download configuration for the development board, and generate the hardware configuration file (ruff_box.json).

# Step 4: Connecting a Device

1. Execute the command rap scan in the application directory to scan your Ruff development board:

If everything goes well, you should see your Ruff device in the list, as follows:

1. Press enter to select your device, and rap will remember it for future operations. This only takes effect in the application folder. Follow the rap prompts to set for the development board. You may also set up a password to avoid (to some degree) unauthorized operations.

# Step 4: Getting Started

Refer to Getting Started, it’s time write your own Ruff application.