M5stickC and VL53L1X sensor GROVE port
-
Hi, is it possible to connect VL53L1X sensor to M5StickC on GROVE port?
I dont know how to set sda and scl pins of the GROVE... maybe with Wire1 ??
I'm using arduino IDE
this code doesn't work..#include <M5StickC.h> #include <Wire.h> #include <VL53L1X.h> VL53L1X sensor; float accX = 0; float accY = 0; float accZ = 0; int cm; int feet; int inches; int INCHES; bool unit = 0; #define TFT_GREY 0x5AEB // New colour void setup() { M5.begin(); Wire.begin(); Wire.begin(32, 33); // (SDA, SCL) grove stickC Wire.setClock(400000); // use 400 kHz I2C M5.Lcd.setRotation(3); M5.MPU6886.Init(); sensor.setDistanceMode(VL53L1X::Long); sensor.setMeasurementTimingBudget(50000); sensor.startContinuous(50); } void loop() { M5.MPU6886.getAccelData(&accX, &accY, &accZ); if (accX < 0) { M5.Lcd.setRotation(3); } else { M5.Lcd.setRotation(1); } cm = (sensor.read() / 10); //CM inches = cm / 2, 54; feet = inches / 12; INCHES = inches % 12; //es x = 7% 5; // X ora contiene 2 M5.Lcd.fillScreen(TFT_GREY); M5.Lcd.setCursor(10, 16); M5.Lcd.setTextColor(TFT_YELLOW); M5.Lcd.setTextFont(7); //M5.Lcd.println(12.10); M5.Lcd.println(cm); delay(100); }
tnks a lot
-
nobody?
-
Have you tried this code sample yet?
https://github.com/m5stack/M5-ProductExampleCodes/blob/master/Unit/TOF/Arduino/TOF_VL53L0X/TOF_VL53L0X.inoBTW there is a new TOF Hat for the stick C
https://m5stack.com/collections/all/products/m5stickc-tof-hatvl53l0x
-
@cepics said in M5stickC and VL53L1X sensor GROVE port:
VL53L1X
I tried the VL53L0X unit on the grove port of the stick several times and could not get it to work. I know that really doesn't really help you but at least your are not alone in this quest :)