Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/blundell/PirMotionSensorModuleTut

Android Things - PirSensor Tutorial
https://github.com/blundell/PirMotionSensorModuleTut

android-things iot

Last synced: about 2 months ago
JSON representation

Android Things - PirSensor Tutorial

Awesome Lists containing this project

README

        

### HC-SR501
#### PIR Motion Sensor
##### Android Things User Driver

Accompanying Blog Post:

http://blog.blundellapps.co.uk/tut-android-things-writing-a-pir-motion-sensor-driver/

Simple useage:

```java

@Override
protected void onCreate() {
Gpio bus = bus = new PeripheralManagerService().openGpio("BCM18");
motionSensor = new PirMotionSensor(bus, this);
motionSensor.startup();
}

@Override
public void onMovement() {
Log.d("TUT", "MOVEMENT DETECTED");
}

@Override
protected void onDestroy() {
motionSensor.shutdown();
super.onDestroy();
}

```