You are on page 1of 11

CONECTIVIDAD BLUETOOTH

Bluetoothes una especificacin industrial para


Redes Inalmbricas de rea Personalmediante un enlace
porradiofrecuenciaen labanda ISMde los 2,4GHz. Los
principales objetivos de esta norma son:
Facilitar las comunicaciones entre equipos mviles.
Eliminar los cables y conectores entre stos.
Ofrecer la posibilidad de crear pequeas
redes inalmbricasigitales.

CONECTIVIDAD BLUETOOTH
Modulo Bluetooth
FEATURES
1.-Operatingvoltage:3.3V
2.DefaultBaudRate:9600,8,1,n.
3.Signalcoverage:30feet.
4.Bluetoothversion:V2.0+EDR
5.Series:bluetoothmoduleboardseries
6.Size:about37*16*7mm
7.WithLEDindicatorlight,use150mAand3.3Vregulationchip.
8.WithVCC GND TXD RXDfootfortheBluetooth
9.With"Re-seach"button(ON/OFF/WAKEfootforit,external
MCUoutinput"Highlevel"cancontrolmoduletore-seach)
10.Compatiblewithbluetoothmastermodule" slavemodule"or
master-slave(whole)module.
11.Inputvoltage:3.3~6V

CONECTIVIDAD BLUETOOTH
PROGRAMA EMISOR DEL MICROCONTROLADOR
PROGRAMA EN MIKROC
unsigned int temp_res;

void main() {
ADCON1 = 0x80; // Configure analog inputs and Vref
osccon=0x77;
TRISA = 0xFF; // PORTA is input // Pins RB7, RB6 are outputs
TRISC = 0;
// PORTD is output
Usart_init(9600);
do {

temp_res = Adc_Read(0); // Get results of AD conversion

temp_res = temp_res >> 2; // Send 2 most significant bits to RB7, RB6


Usar_Write(temp_res);
} while(1);
}

CONECTIVIDAD BLUETOOTH
SIMULACION PROTEUS

CONECTIVIDAD BLUETOOTH
ANDROID CONECTADO POR BLUETHOOT
(ENVIO DE VALORES DE 0 A 255) AL VARIAR
POTENCIOMETRO Y GRAFICACION EN
TIEMPO REAL

CONECTIVIDAD BLUETOOTH
PROGRAMA ANDROID CON APPINVENTOR

CONECTIVIDAD BLUETOOTH

CONECTIVIDAD BLUETOOTH

CONECTIVIDAD BLUETOOTH

CONECTIVIDAD BLUETOOTH
/* EMISOR:
ENVIO DE 3 DATOS NUMERICOS CONVERTIDOS A TEXTO POR UART
QUE SERAN CAPTURADOS EN TRES VARIABLES DIFERENTES PARA SER
PROCESADOS, CADA DATO DEBE TENER UN SEPARADOR DIFERENTE %,*,/
LO QUE LE PERMITIRA MANDAR VALORES DE MUCHAS VARIABLES
void main()
{ int R,G,B;
*/
char conversion1[7],conversion2[7],conversion3[7];
//R=33;G=54;B=255;
UART1_Init(9600);
ANSEL = 0xff;
Delay_ms(100);
while(1)
{
R= ADC_Read(0);
G= ADC_Read(1);
B= ADC_Read(2);

intTostr(R,conversion1);
intTostr(G,conversion2);
intTostr(B,conversion3);
Delay_ms(100);
UART1_Write_Text(conversion1);UART1_Write_Text("%");Delay_
UART1_Write_Text(conversion2);UART1_Write_Text("*");Delay_m
UART1_Write_Text(conversion3);UART1_Write_Text("/");Delay_m
}
}

CONECTIVIDAD BLUETOOTH
/* RECEPTOR:
RECIBE DATOS DEL EMISOR Y LOS ALMACENA EN TRES VARIABLES DE TIPO
CARACTER NECESITA BUSCAR SEPARADORS DIFERENTES %,*,/, LO QUE
PERMITE RECIBIR MULTIPLES VARIABLES DESDE EL EMISOR
char string1[7],string2[7],string3[7];
int valor1,valor2,valor3;
*/
void main()
{
ANSEL = 0;
// Configure AN pins as digital
ANSELH = 0;
UART1_Init(9600);
// Initialize UART module at 9600 bps
Delay_ms(100);
// Wait for UART module to stabilize
while (1) {
if (UART1_Data_Ready() == 1)
{
UART1_Read_Text(string1,"%", 10);
UART1_Read_Text(string2,"*", 10);
UART1_Read_Text(string3,"/", 10);
// UART1_Write_Text(string1); UART1_Write_Text(" ");
// UART1_Write_Text(string2); UART1_Write_Text(" ");
// UART1_Write_Text(string3); UART1_Write(13);
valor1=atoi(string1);
valor2=atoi(string2); //char to int
valor3=atoi(string3);
}
}
}

You might also like