Jump to content

Projet terminale STI2D arduino et bluetooth


maxi56

Recommended Posts

Bonjour à tous,

 

j'écris ce post aujourd'hui car je suis depuis maintenant plus de 3 mois sur un projet mais je ne parvient pas à avancer ...

 

Ce fameux projet consiste a développer une application capable de lire en temps réel la vitesse et la décharge d'une batterie de vélo électrique le tout en bluetooth, en récupérant ces données a partir d'une carte arduino uno

 

Je me suis donc intéressé a cette partie programmation mais j'ai beau lire des tutos je ne parvient pas a trouver de programme qui regroupe a la fois la connectivité bluetooth ainsi que l'arduino.

 

merci de bien vouloir m'aider :)

 

maxi56

Edited by maxi56
Link to comment
Share on other sites

  • 1 month later...

je reviens vers vous avec le programme arduino terminé et fonctionnel, module détectable etc...

 
#include <AltSoftSerial.h>

const int bluetoothTx = 9;
const int bluetoothRx = 8;

AltSoftSerial bluetooth(bluetoothTx, bluetoothRx);

void setup()
{
 pinMode(bluetoothTx, OUTPUT);
 pinMode(bluetoothRx, INPUT);
 
 Serial.begin(38400);  
 bluetooth.begin(9600);
 delay(1000);
       
 bluetooth.print("\r\nAT+INIT\r\n");             // inizializzazione SPP
 bluetooth.print("\r\nAT+ROLE=0\r\n");           // imposta come slave  
 bluetooth.print("\r\nAT+IAC=9E8B33\r\n");       // impostazione Inquire Access Code di default
 bluetooth.print("\r\nAT+CLASS=0\r\n");          // accetta in connessione tutte le tipologie di dispositivo
 bluetooth.print("\r\nAT+INQM=1,9,48\r\n");      // inquire mode: RSSI, max 9, timeout 48
 bluetooth.print("\r\nAT+INQ\r\n");              // avvio
 delay(1000);
 
 Serial.print("Bluetooth should be initialized now");
}

void loop()
{
 if( bluetooth.available() )
   Serial.print(bluetooth.read());
   
 if( Serial.available() )
    bluetooth.write(Serial.read());    
}

 

mais toujours impossible de trouver un programme android pour la lecture des données émises par le module xbee,

auriez-vous des exemples d'appli a me proposer parce que là je suis réellement perdu ...

merci

Link to comment
Share on other sites

Pour résumer, les infos des capteurs sont réunis sur un fichier texte lui même contenu dans une carte SD. Le principe de cette application est de lire ces infos en bluetooth et de les afficher sur l'écran de façon lisible.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...