Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
harlem88 committed Apr 9, 2016
1 parent f939a98 commit 36b7751
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,14 @@ Library for Udoo Blu board
dependencies {
compile 'org.udoo:udooblulib:0.1'
}
2. Add in your `AndroidManifest.xml` UdooBluService class

<service
android:name="org.udoo.udooblulib.service.UdooBluService"
android:exported="false" />

2. In your `onCreate` method in Application class, bind the `UdooBluManager`.
3. In your `onCreate` method in Application class, bind the `UdooBluManager`.

@Override
public void onCreate() {
Expand All @@ -33,7 +39,7 @@ Library for Udoo Blu board
return mUdooBluManager;
}

3. Connect ble device:
4. Connect ble device:

mUdooBluManager.connect(address1, new IBleDeviceListener() {
@Override
Expand All @@ -52,12 +58,12 @@ Library for Udoo Blu board
}
});

4. Enable notifications
5. Enable notifications

udooBluManager.enableSensor(address1, UDOOBLESensor.ACCELEROMETER, true);
udooBluManager.setNotificationPeriod(address1, UDOOBLESensor.ACCELEROMETER);

5. Listen notifications
6. Listen notifications

udooBluManager.enableNotification(address1, true, UDOOBLESensor.ACCELEROMETER, new OnCharacteristicsListener() {
@Override
Expand All @@ -71,6 +77,6 @@ Library for Udoo Blu board
subscriber.onNext(point3D.toFloatArray());
}
});
6. Digital write
7. Digital write

mUdooBluManager.digitalWrite(address1, IOPIN_VALUE.HIGH, IOPIN.D6);

0 comments on commit 36b7751

Please sign in to comment.