Good day!
I have an Arduino Uno and HC-05 Bluetooth Module. The connection is:
HC-05 Arduino
State - Unconnected
Rx - Tx
Tx - Rx
Gnd - Gnd
Vcc - 5V
- Vin is connected to a 9V battery.
- The red light is blinking fast (I read that this is just powered, not yet ready to pair)
- Already tried holding the button during power up, but the blinking light slowed down (I read somewhere that it means it is ready to pair, yet its still not discovered by my laptop)
- I also can't type AT command because of this
I have read and watched a lot of tutorials but the HC-05 Module is still undiscoverable by my laptop. I hope someone helps. Thanks!!
CODE:
// Define analog input
#define ANALOG_IN_PIN A0
// Floats for ADC voltage & Input voltage
float adc_voltage = 0.0;
float in_voltage = 0.0;
// Floats for resistor values in divider (in ohms)
float R1 = 30000.0;
float R2 = 7500.0;
float ref_voltage = 5.0; // Float for Reference Voltage
int adc_value = 0; // Integer for ADC value
int knock = 7; //Sensor signal
int led = 13;
int val;
int countr = 0;
void setup() {
Serial.begin(9600);
pinMode(led,OUTPUT);
pinMode(knock,INPUT);
}
void loop() {
val = digitalRead(knock); // read and assign the value of digtal interface 3 to value
if(val == LOW) //when sensor detect a signal, LED flashes
countr = countr + 1;
voltage_read();
delay(250);
}
void voltage_read() {
adc_value = analogRead(ANALOG_IN_PIN); // Read the Analog Input
adc_voltage = (adc_value * ref_voltage) / 1024.0; // Determine voltage at ADC input
in_voltage = adc_voltage / (R2/(R1+R2)) ; // Calculate voltage at divider input
// Print results to Serial Monitor to 2 decimal places
Serial.print("Input Voltage = ");
Serial.println(in_voltage, 2);
Serial.print("Counter = ");
Serial.println(countr);
Serial.println();
}