Skip to content

OpenFL extension for reading distance from a VL53L1X time of flight sensor via i2c

Notifications You must be signed in to change notification settings

gepatto/SensorVL53L1X

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SensorVL53L1X OpenFL Extension for Raspberry Pi

Reading data from a VL53L1x Distance Sensor connected via i2c

This extension is a wrapper for code taken from:
https://www.waveshare.com/wiki/VL53L1X_Distance_Sensor

build with: lime rebuild . rpi -clean

installation

checkout and add:
haxelib dev SensorVL53L1X path_to_SensorVL53L1X

add to project.xml
<haxelib name="SensorVL53L1X" />

example usage

    import sensors.SensorVL53L1X;
    import sensors.vl53l1x.events.DistanceEvent;

    ----
    var sensor = new SensorVL53L1X();
    if( sensor.initialize() ){
        sensor.addEventListener ( DistanceEvent.DISTANCE,  sensor_distance);
        sensor.startMeasuring();
    }

    private function sensor_distance (event:DistanceEvent):Void{
        trace('distance ${event.distance}');
    }

scheam

About

OpenFL extension for reading distance from a VL53L1X time of flight sensor via i2c

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published