Dear all,
Could I use a 08M2 to PWM an IR led at 38KHz 50% duty cycle using the pwmout command at pin c.2 and an IR remote control receiver at 38KHz at c.3 to detect an objects presence by IR reflection? would the code below work?
[start:
high c.0 'green led on
low c.1 'red led off
pwmout 2, 25, 51 '38KHz pwm 50% duty cycle for IR led
if pinc.3 = 0 then goback 'pinc.3 connected to 38KHz IR receiver for remote controls
goto start
goback:
high c.1 'red led on
low c.0 'green led off
pause 500
goto start]
thanks,
Antony
Could I use a 08M2 to PWM an IR led at 38KHz 50% duty cycle using the pwmout command at pin c.2 and an IR remote control receiver at 38KHz at c.3 to detect an objects presence by IR reflection? would the code below work?
[start:
high c.0 'green led on
low c.1 'red led off
pwmout 2, 25, 51 '38KHz pwm 50% duty cycle for IR led
if pinc.3 = 0 then goback 'pinc.3 connected to 38KHz IR receiver for remote controls
goto start
goback:
high c.1 'red led on
low c.0 'green led off
pause 500
goto start]
thanks,
Antony