Wiring
Arduino With IR Obstacle
PIN 7 --------------- Out
5V ---------------- 5V
GND --------------- GND
Arduino With Bluetooth HC05
Tx ---------------- Rx
Rx ---------------- Tx
5V ---------------- 5V
GND --------------- GND
Arduino Sketch
int n;
void setup () {
pinMode (7, INPUT);
Serial.begin (9600);
}
void loop () {
if (digitalRead (7) == LOW) {
n ++;
Serial.print (n);
delay (1000);
}
}
Arduino With IR Obstacle
PIN 7 --------------- Out
5V ---------------- 5V
GND --------------- GND
Arduino With Bluetooth HC05
Tx ---------------- Rx
Rx ---------------- Tx
5V ---------------- 5V
GND --------------- GND
Arduino Sketch
int n;
void setup () {
pinMode (7, INPUT);
Serial.begin (9600);
}
void loop () {
if (digitalRead (7) == LOW) {
n ++;
Serial.print (n);
delay (1000);
}
}
Show More