Timing system utilizing two tfminis and an lcd

Hello all, I've been attempting to craft a timing system for my school's track team by utilizing two tf minis that are connected by a wireless transceiver from hiLetgo on amazon. My issue arises from getting both the transceivers to work and to get the timers to function and print on the lcd. I don't know how the receivers talk to one another or if I'd need a set of code for such. I also cannot see that the timer has started as it won't print on my lcd. My code is below. Any help is greatly appreciated!

#include <LiquidCrystal.h>
#include "Timer.h"
#include <SoftwareSerial.h>
#include "TFMini.h"
TFMini tfmini;
Timer timer;
SoftwareSerial SerialTFMini(2, 3);  //The only value that matters here is the first one, 2, Rx
const int rs = 12, en = 11, d4 = 7, d5 = 6, d6 = 5, d7 = 4;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
void getTFminiData(int* distance, int* strength) {
  static char i = 0;
  char j = 0;
  int checksum = 0;
  static int rx[9];
  if (SerialTFMini.available()) {
    rx[i] = SerialTFMini.read();
    if (rx[0] != 0x59) {
      i = 0;
    } else if (i == 1 && rx[1] != 0x59) {
      i = 0;
    } else if (i == 8) {
      for (j = 0; j < 8; j++) {
        checksum += rx[j];
      }
      if (rx[8] == (checksum % 256)) {
        *distance = rx[2] + rx[3] * 256;
        *strength = rx[4] + rx[5] * 256;
      }
      i = 0;
    } else {
      i++;
    }
  }
}


void setup() {
  Serial.begin(115200);  //Initialize hardware serial port (serial debug port)
  while (!Serial)
    ;  // wait for serial port to connect. Needed for native USB port only
  Serial.println("Initializing...");
  SerialTFMini.begin(TFMINI_BAUDRATE);  //Initialize the data rate for the SoftwareSerial port
  tfmini.begin(&SerialTFMini);          //Initialize the TF Mini sensor
}

void loop() {
  int distance = 0;
  int strength = 0;

  getTFminiData(&distance, &strength);
  while (!distance) {
    getTFminiData(&distance, &strength);

    if (distance < 150)
      if (timer.state() == RUNNING) (timer.stop);
      else timer.start();

    lcd.print(currentMillis());
  }
  delay(00);
}

Welcome to the forum

It looks like you tried to post your code using code tags but got it wrong

In my experience the easiest way to tidy up the code and add the code tags is as follows

Start by tidying up your code by using Tools/Auto Format in the IDE to make it easier to read. Then use Edit/Copy for Forum and paste what was copied in a new reply. Code tags will have been added to the code to make it easy to read in the forum thus making it easier to provide help.

Please edit your post and insert the code again as described above

can you give a link to the modules?

could you take @UKHeliBob's advice and reformat the code in post 1 as in it's present state it is very difficult to read
note that the nRF24L01 referenced in the link in post 4 use an SPI interface yet I can only see SoftwareSerial in the code of post 1
did you post the correct link?

Okay I think the code is fixed and yes that should be the link to the product on amazon

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