Hi guys I have this BT, but when I connect it to my arduino I do not recognize any device. Can it be that the receiver is broken?
I have tried in all tx and rx
the code:
int valor = 0;
int select = 0;
int valor2 = 0;
void setup()
{
Serial.begin(9600);
}
void loop()
{
if(Serial.available() > 0)
{
select = Serial.read();
switch(select)
{
case 'a': //Si se escribe "a" nos enviara la temperatura del LM35
valor = analogRead(A0); // Se lee el ADC 0 y el valor se guarda en la variable “valor”
Serial.print((5.0 * valor * 100)/1023);
delay(10); // Retardo de 10 milisegundos
Serial.println("°C LM35");
delay(5000);
break;
case 'b':
valor2 = analogRead(A1);
Serial.print((5 * valor2 * 100)/1023);
delay(10); // Retardo de 10 milisegundos
Serial.println("°C MCP9701");
delay(5000);
break;
default:
Serial.println("error");
delay(500);
}
}
}
click the MODIFY button in the upper right of the post window.
Highlight all you code.
click the "#" CODE TAGS button on the toolbar above just to the left of the QUOTE button.
click SAVE (at the bottom).
When you post code on the forum, please make a habit of using the code tags "#" button.
I would simplify the code for the initial testing if the device actually works. For instance, try just sending some string over BT to your computer/phone, forget about input for sensor etc:
teoqba:
I would simplify the code for the initial testing if the device actually works. For instance, try just sending some string over BT to your computer/phone, forget about input for sensor etc: