Proximity code
void ir_detect() {
turn on emitter
sleep for 600us // wait at 1667Hz
val_on = read detector // emitter is on
turn off emitter
sleep for 600us // wait at 1667Hz
val_off = read detector // while emitter off
return( val_on & ~val_off );
}
Previous slide
Next slide
Back to first slide
View graphic version