Hi, I'm trying to make an obstacle sensor with tsop 1738 and IR led, and I need to set led frequency 38kHz
now my code is:
//this variables are not changing
const int ir_left = 2; //IR led
const int tsop = 5; //TSOP1738//starting tsop state
int tsop_state = 0;void setup(){
pinMode(tsop, INPUT);
pinMode(ir_left, OUTPUT);
Serial.begin(9600);
}void loop(){
digitalWrite(ir_left, HIGH); //set led on
tsop_state = digitalRead(tsop); //tsop
Serial.println(tsop_state); //print tsop state
delay(3000);
}
so what is missing?