Ask for help:Arduino + VL53L0X +TB6600

Arduino + VL53L0X +TB6600 stepper motor realizes distance tracking. For example, when the target is far away, the motor will follow up to 50mm, and when the target is close, the motor will move away to 50mm.

@bhexue, your topic was moved to a more suitable location on the forum.

Have you done any research? E.g. search for the keyword Arduino in combination with each of the boards that you use? There might be libraries that you can use or examples; if so, study the examples.

I would like to use Z axis control for laser engraving machine, who can make a sketch for me

and the question is ?


My question is how to integrate the laser rangefinder program with the stepper motor control program. My sculpting target is the surface and I want the laser to track the surface. Let the Z axis track this surface.

Many of the forum members could make that sketch.

Most will not, because they want you to learn to write the sketch and will help you, but will not write it for you. There is an old saying about giving a man a fish, do you know it?

Other forum members will write the sketch for you if you pay them. If you want the sketch to be written well and be reliable, this will be expensive. If you want a poorly written and unreliable sketch, that will be less expensive. If you want to offer payment for the sketch, flag your topic to the forum moderators and ask for it to be moved to the "gigs and collaborations" section.

#include <Stepper.h>#include "Adafruit_VL53L0X.h"#define STEPS 400Stepper stepper(STEPS, 9, 10);Adafruit_VL53L0X frontTOF = Adafruit_VL53L0X();float ranges[100] = {0};int p = 0;void setup(){ Serial.begin(115200);stepper.setSpeed(130);while (! Serial) { delay(1); } Serial.println("Adafruit VL53L0X test"); if (!frontTOF.begin()) { Serial.println(F("Failed to boot VL53L0X")); while(1); } // power Serial.println(F("VL53L0X API Simple Ranging example\n\n"));}void loop() { VL53L0X_RangingMeasurementData_t measure;Serial.print("Reading a measurement... "); frontTOF.rangingTest(&measure, false); // pass in 'true' to get debug data printout!if (measure.RangeStatus != 4) { Serial.print("Distance (mm): "); Serial.println(measure.RangeMilliMeter); } else { Serial.println(" out of range "); } while(p < 50) {ranges[p] = (float)measure.RangeMilliMeter/105;stepper.step(+1);++p; delay(100);}while(p >50) {stepper.step(-1);--p;}}
I don't know what's wrong with it. I can do range but the motor doesn't work. What's wrong with it?

:roll_eyes: Please read the forum guide.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.