Android Things - PirSensor Tutorial
Java
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
gradle/wrapper
.gitignore
README.MD
build.gradle
gradle.properties
gradlew
gradlew.bat
settings.gradle

README.MD

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:

   @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();
    }