Problem with Arduino Bluetooth

Hi everyone. We decided to post a message on this forum because we have a problem in our arduino code. Our installation includes a temperature sensor, an arduino card and an HC-05 Bluetooth module. Our sensor works well it sends the data to the computer the problem does not come from there. We would like to be able to send the collected temperatures automatically and regularly thanks to the Bluetooth module.
Our setup is correct since we can send messages from the phone to the computer and from the computer to the phone. We are therefore trying to include in our code a function that allows us to send temperatures without manipulating the computer. (Knowing that temperatures already arrive regularly from the sensor to the computer.)
We would like to remind you that we are amateurs.
Thank you very much, and we hope you can help us. :slight_smile:

/* Librairie Wire pour les communications I2C */
#include <Wire.h>
#include <SoftwareSerial.h>

/* Adresse par défaut du capteur IR */
#define I2C_ADDR 0x5A
#define rxPin 11 // Broche 11 en tant que RX, à raccorder sur TX du HC-05
#define txPin 10 // Broche 10 en tant que TX, à raccorder sur RX du HC-05

SoftwareSerial mySerial(rxPin, txPin);

/** Fonction setup() */
void setup() {

/* Initialisation du port série (pour debug) */
Serial.begin(115200);
Serial.println(F("BOOT"));
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);
mySerial.begin(9600);
Serial.begin(9600);

/* Initialisation du bus I2C */
Wire.begin();
}

/** Fonction loop() */
void loop() {

/* Données brute de température */
uint16_t data;

/* Commande de lecture de la RAM à l'adresse 0x07 */
Wire.beginTransmission(I2C_ADDR);
Wire.write(0x07);
Wire.endTransmission(false);

/* Lecture des données : 1 mot sur 16 bits + octet de contrôle (PEC) */
Wire.requestFrom(I2C_ADDR, 3, false);
while (Wire.available() < 3);
data = Wire.read();
data |= (Wire.read() & 0x7F) << 8; // Le MSB est ignoré (bit de contrôle d'erreur)
Wire.read(); // PEC
Wire.endTransmission();

/* Calcul de la température */
const float tempFactor = 0.02; // 0.02°C par LSB -> résolution du MLX90614
float tempData = (tempFactor * data) - 0.01;
float celsius = tempData - 273.15; // Conversion des degrés Kelvin en degrés Celsius

/* Affichage de la température */
Serial.print(F("Celsius: "));
Serial.println(celsius);

/* Temps d'attente */
delay(1000);

int i = 0;
char someChar[32] = {0};
if(Serial.available()) {
do{
someChar[i++] = Serial.read();

delay(3);

}while (Serial.available() > 0);

mySerial.println(someChar);
Serial.println(someChar);
}

while(mySerial.available())
Serial.print((char)mySerial.read());

}

Have your tried to print it to the phone using software serial?

  /* Affichage de la température */
  Serial.print(F("Celsius: "));
  Serial.println(celsius);

  // print to bluetooth
  mySerial.print(F("Celsius: "));
  mySerial.println(celsius);

The first few lines are for reference.

What is this supposed to do? Was it just for testing?

  int i = 0;
  char someChar[32] = {0};
  if(Serial.available()) {
    do{
      someChar[i++] = Serial.read();
 
     delay(3);
 
    }while (Serial.available() > 0);
 
    mySerial.println(someChar);
    Serial.println(someChar);
  }
 
  while(mySerial.available())
    Serial.print((char)mySerial.read());

Please edit your post and use code tags
type
** **[code]** **
before your code
type
** **[/code]** **
after your code