tfmini icon indicating copy to clipboard operation
tfmini copied to clipboard

External trigger issue

Open Drayak335 opened this issue 6 years ago • 1 comments

During my tests I was not able to get the external trigger to work, after some tests using a usb to UART I noticed that its not needed to change to config mode the sensor.

commenting out the setConfigMode() calls worked for me.

At the end I used it as below.

// Set single scan mode (external trigger)
void TFMini::setSingleScanMode() {
  // not needed ->setConfigMode();
  // setting trigger source to external
  streamPtr->write((uint8_t)0x42);
  streamPtr->write((uint8_t)0x57);
  streamPtr->write((uint8_t)0x02);
  streamPtr->write((uint8_t)0x00);
  streamPtr->write((uint8_t)0x00);
  streamPtr->write((uint8_t)0x00);
  streamPtr->write((uint8_t)0x00);
  streamPtr->write((uint8_t)0x40);
}

// Send external trigger
void TFMini::externalTrigger() {
  // not needed -> setConfigMode();      
  // send trigger
  streamPtr->write((uint8_t)0x42);
  streamPtr->write((uint8_t)0x57);
  streamPtr->write((uint8_t)0x02);
  streamPtr->write((uint8_t)0x00);
  streamPtr->write((uint8_t)0x00);
  streamPtr->write((uint8_t)0x00);
  streamPtr->write((uint8_t)0x00);
  streamPtr->write((uint8_t)0x41);
}

Drayak335 avatar Feb 18 '19 20:02 Drayak335

I can confirm that this is how it works. Don't know why this is the case

Chancylvania avatar Oct 11 '20 13:10 Chancylvania