This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

  • 0 voto(s) - 0 Media
  • 1
  • 2
  • 3
  • 4
  • 5
Cómo configurar una placa Freaduino y un módulo HC-05 Bluetooth
#1
Buenas noches compis,

Tengo una placa base Freaduino y un módulo HC-05 Bluetooth. Estoy empezando con esto de la electrónica y estoy intentándolo programar desde la web de BQ en Bitbloq, ¿alguien me podría echar una mano.

Muchísimas gracias de antemano, ¡saludos!  Blush

También comentar que he intentado conectarlo a mi smartphone a través de la aplicación Ardudroid, un saludo.
  Responder
#2
A ver si esto te es de ayuda http://diwo.bq.com/ejemplo-en-bitbloq-de...bluetooth/
Un Saludo y suerte!
  Responder
#3
(02-11-2016, 03:54 PM)Iván escribió: A ver si esto te es de ayuda http://diwo.bq.com/ejemplo-en-bitbloq-de...bluetooth/
Un Saludo y suerte!

Muchas gracias Iván por tu ayuda.

Lo estuve mirando anteriormente al abrir el post y no hubo manera de que funcionara.  Triste Triste

A ver si me podéis echar una mano, que me temo que puedo estar haciendo algo mal para que conecte el bluetooth a mi teléfono.

Gracias de antemano, saludos compañeros.
  Responder
#4
Fotografía 
(02-11-2016, 11:48 PM)ernestot87 escribió:
(02-11-2016, 03:54 PM)Iván escribió: A ver si esto te es de ayuda http://diwo.bq.com/ejemplo-en-bitbloq-de...bluetooth/
Un Saludo y suerte!

Muchas gracias Iván por tu ayuda.

Lo estuve mirando anteriormente al abrir el post y no hubo manera de que funcionara.  Triste Triste

A ver si me podéis echar una mano, que me temo que puedo estar haciendo algo mal para que conecte el bluetooth a mi teléfono.

Gracias de antemano, saludos compañeros.

Buenas tardes,

Resubo este tema ya que soy incapaz de que funcione con la app Ardudroid. Adjunto fotos y explicación de lo que he realizado.

[Imagen: Whats_App_Image_2016_11_21_at_17_40_29.jpg]

[Imagen: Whats_App_Image_2016_11_21_at_17_40_28.jpg]

[Imagen: program_BT.png]

Tras cargar el programa, intento conectarme desde mi smartphone a el Bluetooth. Desde la app Ardudroid encuentra el dispositivo y me dice que se ha conectado pero no recibo ninguna información:

[Imagen: Whats_App_Image_2016_11_21_at_17_49_32.jpg]

[Imagen: Whats_App_Image_2016_11_21_at_17_49_18.jpg]

Una vez que se conecta, ¿la luz del Bluetooth debería quedar fija en lugar de quedarse parpadeando?¿Puede ser que la aplicación de Ardudroid de problemas? ¿La habéis utilizado o me aconsejaríais alguna otra?


Gracias de antemano, un saludo

  Responder
#5
Sí, la luz debe quedarse fija o parpadeando pero más lento que antes. No he utilizado mucho bitbloq. Prueba a meterle el código directamente desde el IDE del Arduino, haz un copia y pega y comprueba si funciona. Si funciona el problema estaría en la programación de bitbloq; si no,  en el módulo BT. De todas formas en vez de utilizar  ardudroid te aconsejaría crearte tú mismo una app sencillita que envíe un 0 o un 1 para encender un LED con Mit App Inventor. Hay varios tutoriales de él en YouTube.
Código:
/*
PROJECT: ArduDroid
PROGRAMMER: Hazim Bitar (techbitar at gmail dot com)
DATE: Oct 31, 2013
FILE: ardudroid.ino
LICENSE: Public domain
*/

#define START_CMD_CHAR '*'
#define END_CMD_CHAR '#'
#define DIV_CMD_CHAR '|'
#define CMD_DIGITALWRITE 10
#define CMD_ANALOGWRITE 11
#define CMD_TEXT 12
#define CMD_READ_ARDUDROID 13
#define MAX_COMMAND 20  // max command number code. used for error checking.
#define MIN_COMMAND 10  // minimum command number code. used for error checking.
#define IN_STRING_LENGHT 40
#define MAX_ANALOGWRITE 255
#define PIN_HIGH 3
#define PIN_LOW 2

String inText;

void setup() {
 Serial.begin(9600);
 Serial.println("ArduDroid 0.12 Alpha by TechBitar (2013)");
 Serial.flush();
}

void loop()
{
 Serial.flush();
 int ard_command = 0;
 int pin_num = 0;
 int pin_value = 0;

 char get_char = ' ';  //read serial

 // wait for incoming data
 if (Serial.available() < 1) return; // if serial empty, return to loop().

 // parse incoming command start flag
 get_char = Serial.read();
 if (get_char != START_CMD_CHAR) return; // if no command start flag, return to loop().

 // parse incoming command type
 ard_command = Serial.parseInt(); // read the command
 
 // parse incoming pin# and value  
 pin_num = Serial.parseInt(); // read the pin
 pin_value = Serial.parseInt();  // read the value

 // 1) GET TEXT COMMAND FROM ARDUDROID
 if (ard_command == CMD_TEXT){  
   inText =""; //clears variable for new input  
   while (Serial.available())  {
     char c = Serial.read();  //gets one byte from serial buffer
     delay(5);
     if (c == END_CMD_CHAR) { // if we the complete string has been read
       // add your code here
       break;
     }              
     else {
       if (c !=  DIV_CMD_CHAR) {
         inText += c;
         delay(5);
       }
     }
   }
 }

 // 2) GET digitalWrite DATA FROM ARDUDROID
 if (ard_command == CMD_DIGITALWRITE){  
   if (pin_value == PIN_LOW) pin_value = LOW;
   else if (pin_value == PIN_HIGH) pin_value = HIGH;
   else return; // error in pin value. return.
   set_digitalwrite( pin_num,  pin_value);  // Uncomment this function if you wish to use
   return;  // return from start of loop()
 }

 // 3) GET analogWrite DATA FROM ARDUDROID
 if (ard_command == CMD_ANALOGWRITE) {  
   analogWrite(  pin_num, pin_value );
   // add your code here
   return;  // Done. return to loop();
 }

 // 4) SEND DATA TO ARDUDROID
 if (ard_command == CMD_READ_ARDUDROID) {
   // char send_to_android[] = "Place your text here." ;
   // Serial.println(send_to_android);   // Example: Sending text
   Serial.print(" Analog 0 = ");
   Serial.println(analogRead(A0));  // Example: Read and send Analog pin value to Arduino
   return;  // Done. return to loop();
 }
}

// 2a) select the requested pin# for DigitalWrite action
void set_digitalwrite(int pin_num, int pin_value)
{
 switch (pin_num) {
 case 13:
   pinMode(13, OUTPUT);
   digitalWrite(13, pin_value);  
   // add your code here      
   break;
 case 12:
   pinMode(12, OUTPUT);
   digitalWrite(12, pin_value);  
   // add your code here      
   break;
 case 11:
   pinMode(11, OUTPUT);
   digitalWrite(11, pin_value);        
   // add your code here
   break;
 case 10:
   pinMode(10, OUTPUT);
   digitalWrite(10, pin_value);        
   // add your code here
   break;
 case 9:
   pinMode(9, OUTPUT);
   digitalWrite(9, pin_value);        
   // add your code here
   break;
 case 8:
   pinMode(8, OUTPUT);
   digitalWrite(8, pin_value);        
   // add your code here
   break;
 case 7:
   pinMode(7, OUTPUT);
   digitalWrite(7, pin_value);        
   // add your code here
   break;
 case 6:
   pinMode(6, OUTPUT);
   digitalWrite(6, pin_value);        
   // add your code here
   break;
 case 5:
   pinMode(5, OUTPUT);
   digitalWrite(5, pin_value);
   // add your code here      
   break;
 case 4:
   pinMode(4, OUTPUT);
   digitalWrite(4, pin_value);        
   // add your code here
   break;
 case 3:
   pinMode(3, OUTPUT);
   digitalWrite(3, pin_value);        
   // add your code here
   break;
 case 2:
   pinMode(2, OUTPUT);
   digitalWrite(2, pin_value);
   // add your code here      
   break;      
   // default:
   // if nothing else matches, do the default
   // default is optional
 }
}
  Responder


Posibles temas similares…
Tema Autor Respuestas Vistas Último mensaje
  Placa MEGA(china) la reconoce como UNO Jaimelito 1 888 18-11-2020, 10:15 PM
Último mensaje: asesorplaza1
  APORTE mp3 catalex y bluetooth hc 06 katxarix 0 873 18-04-2020, 10:20 AM
Último mensaje: katxarix
  CONSULTA AUMENTAR ALCANCE MÓDULO BLUETOOTH AT-09 CON ANTENA Alvaro Braca 3 2,704 14-03-2019, 09:12 AM
Último mensaje: Merenat
  APORTE Control de Persiana por bluetooth kuadri 0 1,467 16-06-2018, 11:33 PM
Último mensaje: kuadri
  Problema con bluetooth y comandos AT sejiozosky 41 17,481 06-05-2018, 11:48 AM
Último mensaje: Iván