Skip to content

Commit a333759

Browse files
committed
infrared sensor read
Signed-off-by: vesselofgod <[email protected]>
1 parent dbf4db6 commit a333759

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

infrared_sensor.ino

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
int Rightpin = 6;
2+
int Leftpin = 9;
3+
void setup() {
4+
Serial.begin(9600);
5+
pinMode(Rightpin, INPUT);
6+
pinMode(Leftpin, INPUT);
7+
}
8+
9+
void loop() {
10+
int Rightdata;
11+
12+
int Leftdata;
13+
Rightdata = analogRead(Rightpin);
14+
Leftdata = analogRead(Leftpin);
15+
Serial.print(Rightdata);
16+
Serial.println(Leftdata);
17+
delay(50);
18+
}

0 commit comments

Comments
 (0)