이건 미완성 코드인데 부분적으로 필요하신 분들은 사용이 가능합니다.   인용을 허합니다.

 

esp32_drone_code.7z
0.01MB

 

이 안에는 3개의 화일이 있는데 모두 아두이노 IDE에서 열면 쉽게 작업할 수 있게 여러 화일탭으로 열립니다.

 

 

Wiring the VL53L0X ToF Accurate Laser Ranging / 

Distance Measuring Sensor on Microcontroller



This is the VL53LOX breakout module a type of ToF (Time-of-Flight) laser ranging sensor in smallest package capable of delivering accurate distance measurements whatever the object reflectance compared to conventional measuring sensor, the VL53LOX can measure a distance up to 2 meter. This sensor has integrated SPAD (Single Photon Avalanche Diodes) and a 2nd generation Flight SenseTM patented technology from STM. The VL53LOX Vertical Cavity Surface Emitting Laser is totally invisible to the eye along with the internal physical infrared filters, enables a longer ranging distance in a higher immunity to ambient light and better robustness to cover-glass optical cross communication. This device is suitable for computers, energy saving, robotics, households appliances, industrial, building automation and automotive.  for further details please refer to the datasheet below.

Required Components

  • Arduino Microcontroller, ESP8266 12, 12E, ESP8266 NodeMCU, ESPDuino, ATMEGA328 16/12, ATMEGA32u4 16/8/ MHz, ESP8266, ATMEGA250 16 MHz, ATSAM3x8E, ATSAM21D, ATTINY85 16/8 MHz (Note: The Diagram below is using NANO. (please refer to the respective pin-outs)
  • VL53L0X Sensor / Module
  • Solder Less Bread Board
  • Jumper Wires / DuPont Wires

Wiring Guide



Source Code

The code below used this <VL53X.H> library if you want to use other library please refer to the downloads option below.


============= THIS IS BEGINING OF CODE BLOCK =================

#include <Wire.h> //Import wire library

#include <VL530X.h> //Import VL530X library


VL53L0X myDistanceSensor;


void setup(){

    Serial.begin(9600);

    Serial.println("14CORE | Range Measurements with VL53L0X Test");

    Serial.println("Starting....");

    Serial.pirntln("----------------------------------------------");

    delay(200);

    Serial.println("Initializing continuous....");

    Wire.begin();

    myDistanceSensor.init();

    myDistanceSensor.setTimeout(500);

    myDistanceSensor.startContinuous(); //Using continuous time mode place inter-measurement period in ms ex: .startContinuous(100)).

}


void loop(){

    Serial.println(myDistanceSensor.readRangeContinuousMillimeters());

    if (myDistanceSensor.timeoutOccurred()){

        Serial.println("TIMEOUT............................");

        Serial.println();

    }

}

============= THIS IS END OF CODE BLOCK =================

Downloads


My CJMCU-VL53L0X Laser ToF Time-of-Flight Ranging Sensor Module For Arduino


US $ 10.56


Features:

Absolute measurement range of up to 2 meters, less than 30ms
940nm Laser VCSEL
Power supply: 3-5V
Communication: I2C IIC 3-5V

Package included:

1 x Sensor



My MPU-9250 


US $ 5.10


 
Name: MPU-9250 module (three-axis gyroscope + three-axis acceleration + three-axis magnetic field)
Module Model: GY-9250
Use chip: MPU-9250
Power supply: 3-5V (internal low voltage regulator)
Communication method: Standard IIC communication protocol
Chip built-in 16bit AD converter, 16-bit data output
Gyroscope range: ± 250 500 1000 2000 ° / s
Acceleration range: ± 2 ± 4 ± 8 ± 16g
Magnetic field range: ± 4800uT
Pin spacing: 2.54mm
Module size: 15mm * 25mm
 
Package includes:
 
1 x GY-9250 9 Axis Sensor Module




+ Recent posts