Uno/Nano 33 BLE/Nano Every differences

I have a sketch which works perfectly on the Uno. It takes data from a sensor and outputs it via bluetooth (HC06 chip) to my phone and I can see the data in a BT terminal program on my phone. (the sketch just sends it via serial at 9600 baud)
When I try to run the code on the Nano 33 BLE or the Nano Every, everything works fine, I can see the data output on the IDE terminal console, but it will not output to the phone. I can connect to the BT chip (HC06) with the phone with each different arduino board, the sketch uploads to each board correctly, all looks good - just no data with Nano 33BLE or Nano Every. As this is going in a small box, I was hoping to move to a smaller form factor with the nano boards.
So why wont these automatically output serial data to the BT chip when the original arduino nano does, no problem...? Nothing is different with the code, and yes, I am using the correct board on the IDE each time when uploading.

We would be more likely to be able to help you if you had posted the sketch, but I'll take a wild guess.

On the Uno, there is only one hardware serial interface: Serial. This is what you will use in your code to communicate with the HC-06 module that is connected to pins 0 and 1. On the Nano 33 BLE and Nano Every, Serial is used only to communicate with the computer over USB. There is a dedicated hardware serial interface named Serial1 attached to pins 0 and 1. So you need to adjust your code to use Serial1 instead of Serial to communicate with the HC-06.

sketch is below. I replaced Serial with Serial1... no difference.

#include <Wire.h>
#include <VL53L1X.h>
VL53L1X sensor;

void setup()
{
Serial1.begin(9600);
Wire.begin();
Wire.setClock(400000); // use 400 kHz I2C

sensor.setTimeout(500);
if (!sensor.init())
{
Serial1.println("Failed to detect and initialize sensor!");
while (1);
}

sensor.setDistanceMode(VL53L1X::Long);
sensor.setMeasurementTimingBudget(50000);
sensor.startContinuous(50);
}

void loop()
{
Serial1.print(sensor.read());
if (sensor.timeoutOccurred()) { Serial1.print(" TIMEOUT"); }

Serial1.println();
}

Please tell us the exact pin connections between the sensor and the Arduino board and the HC-06 and the Arduino board.

Did you try that code on both the Nano Every and the Nano 33 BLE, or only on one of the two?

Ok, I reran and reloaded the code and it worked. Thanks!

You're welcome. I'm glad to hear it's working now. Enjoy!
Per