Envoyer données ( nombres et lettres) via bluetooth

Bonjour, j’ai un projet de chronométre, et j’aimerai envoyer d’un telephone, avec une puce bluetooth bee et app inventor, une variable de temps “record” et le nom de l’équipe qui va courir. ( obtenir t4 et t5 d’un telephone.

voici le début de mon code ( la partie pour le temps est terminée, peut être mal optimisée mais terminée )

#include <Wire.h>
#include <LiquidCrystal_I2C.h>


LiquidCrystal_I2C lcd(0x20, 20, 4);

unsigned long time; // time = fonction millis

long t1=0; // t1= Départ

long t2=0; // t2= Arrivée

long t3=0; // t3= temps de course

long t4=5000; // t4= temps record a initialiser avant démarrage ( a mettre en ms )

long t5=(nom de l'équipe)


boolean statdep = false;

boolean statar = false;

void setup() {
  
    pinMode(9, INPUT);
    pinMode(7, INPUT);
    pinMode(5, OUTPUT);
    pinMode(4, OUTPUT);
    pinMode(10, OUTPUT); 
    lcd.init(); // initialisation de l'afficheur
    lcd.backlight();
    lcd.setCursor(0,0);
    lcd.print("RDV arrivee !");
    lcd.setCursor(0,1);
    lcd.print("CHRONO");
    lcd.setCursor(0,2);
    lcd.print("Record :");
    lcd.setCursor(9,2);
    lcd.print(t4*pow(10,-3));
    lcd.setCursor(14,2);
    lcd.print("s");
    
}


void loop() {


  time=millis();

 
 if (digitalRead(9))
 {
  delay(50);
  statdep = !statdep;
 }


 if (digitalRead(7))
 {
  delay(100);
  statar = !statar;
 }
 
 
  if (statdep==true)
  {
  lcd.clear();
  digitalWrite(4, HIGH);
  digitalWrite(10, HIGH);
  lcd.print("3 !");
  digitalWrite(10, LOW);
  delay(1000);
  digitalWrite(10, HIGH);
  lcd.print(" 2 !");
  digitalWrite(10, LOW);
  delay(1000);
  digitalWrite(10, HIGH);
  lcd.print(" 1 !");
  digitalWrite(10, LOW);
  digitalWrite(4, LOW);
  delay(1000);
  digitalWrite(5, HIGH);
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("Depart !");
  digitalWrite(10, HIGH);
  t1=time;
  statdep = !statdep;
  delay(300);
  digitalWrite(10, LOW);
  }
  


  
  if(t1!=0)
  {  
    while(t3>1);
  {   
  lcd.setCursor(0,1);
  lcd.print((time-t1-3096.5)*pow(10,-3));
  lcd.setCursor(6,1);
  lcd.print("s");
  delay(25);
  }
    }

    
  if (statar==true)
  {
  lcd.clear();
  lcd.setCursor(0, 1);
  lcd.print("Arrivee !");
  t2=time;
  statar = !statar;
  digitalWrite(5, LOW);
  }
  
  t3=t2-t1-3000;
  // différence entre les 2 temps


if (t3>1)
{
  delay(800);
  lcd.noBacklight();
  digitalWrite(5, LOW);
  digitalWrite(4, LOW);
  digitalWrite(10, LOW);
  delay(750);
  lcd.backlight();
  digitalWrite(5, HIGH);
  digitalWrite(4, HIGH);
  digitalWrite(10, HIGH);
  delay(500);
  lcd.noBacklight();
  digitalWrite(5, LOW);
  digitalWrite(4, LOW);
  digitalWrite(10, LOW);
  delay(250);
  lcd.backlight();
  digitalWrite(5, HIGH);
  digitalWrite(4, HIGH);
  digitalWrite(10, HIGH);
  delay(200);
  lcd.noBacklight();
  digitalWrite(5, LOW);
  digitalWrite(4, LOW);
  digitalWrite(10, LOW);
  delay(150);
  lcd.backlight();
  digitalWrite(5, HIGH);
  digitalWrite(4, HIGH);
  digitalWrite(10, HIGH);
  delay(100);
  lcd.noBacklight();
  digitalWrite(5, LOW);
  digitalWrite(4, LOW);
  digitalWrite(10, LOW);
  delay(50);
  lcd.backlight();
  digitalWrite(5, HIGH);
  digitalWrite(4, HIGH);
  digitalWrite(10, HIGH);
  delay(25);
  lcd.noBacklight();
  digitalWrite(5, LOW);
  digitalWrite(4, LOW);
  digitalWrite(10, LOW);
  delay(10);
  lcd.backlight();
  lcd.clear();




if (t3<t4)
{ 
  lcd.setCursor(0, 0);
  lcd.print("Old record =");
  lcd.setCursor(13,0);
  lcd.print(t4*pow(10,-3));
  lcd.setCursor(18,0);
  lcd.print("s");
  lcd.setCursor(0, 1);
  lcd.print("NOUVEAU RECORD !");
  lcd.setCursor(0, 2);
  lcd.print("Tps course =");
  lcd.setCursor(13, 2);
  lcd.print(t3);
  lcd.print(" ms");
  lcd.setCursor(0, 3);
  lcd.print(" = ");
  lcd.print(t3*pow(10,-3));
  lcd.print(" s ");
    
    for (int i=0; i <= 4; i++) {
  digitalWrite(5, HIGH);
  digitalWrite(4, HIGH);
  digitalWrite(10, HIGH);
  delay(200);
  digitalWrite(5, LOW);
  digitalWrite(4, LOW);
  digitalWrite(10, LOW);
  delay(200);

  
}

}

else 
{
  lcd.setCursor(0, 0);
  lcd.print("Record non battu !");
  lcd.setCursor(0, 1);
  lcd.print("Record piste=");
  lcd.setCursor(14,1);
  lcd.print(t4*pow(10,-3));
  lcd.setCursor(18,1);
  lcd.print("s");
  lcd.setCursor(0, 2);
  lcd.print("Tps course =");
  lcd.setCursor(13, 2);
  lcd.print(t3);
  lcd.print("ms");
  lcd.setCursor(0, 3);
  lcd.print(" = ");
  lcd.print(t3*pow(10,-3));
  lcd.print(" s ");
}

}

}

Bonjour et Bienvenue sur le forum

et la question est ??

Prendre le temps de lire la Règle du Forum et les diverses recomendations épinglées sen tête du forum

Vivement que l'on installe un plugin télépathie sur le forum :smiling_imp: