microsoft / pxt-adafruit

Microsoft MakeCode editor for Adafruit Circuit Playground Express
https://makecode.adafruit.com
Other
81 stars 77 forks source link

infrared send number fails after many uses leaving IR diode continuously pulsing #1067

Open kevinjwalters opened 5 years ago

kevinjwalters commented 5 years ago

Describe the bug The infrared send number block fails if it's used many times and it leaves the IR diode continuously pulsing (presumably at 38kHz due to being left sending one long "mark"). This can be visibly seen with the aid of a digital camera since they are sensitive to the IR wavelength. It's also observable by watching the VOUT voltage on an oscilloscope as there's a voltage drop as a side-effect of the intense IR output. It can also be heard because another side-effect of the IR bursts is to the make the CPX speaker chug very quietly.

A loop with this and a 200ms pause runs for approximately 170-190 seconds. I'm not sure how many numbers that's equivalent to sending as the IR transmission takes some time? See full example on https://forums.adafruit.com/viewtopic.php?f=64&t=152767

To Reproduce Steps to reproduce the behavior:

  1. Make a loop with infrared send number and wait for it to fail.
  2. See example: https://makecode.com/_9PsET1fvCEkE (same as screenshot included below).

Expected behavior I would expect it to continue sending the IR code for the value I choose forever.

Screenshots infinite-loop-sending-IR-terminates-leaving-IR-pulsing-i

Desktop (please complete the following information): Broswer is n/a. MakeCode versions:

Adafruit Circuit Playground Express version:  1.4.30
Microsoft MakeCode version:  5.13.6
codal-circuit-playground runtime version:  v1.5.4-i2c_and_dac.0

Smartphone (please complete the following information):

Additional context Circuit Playground Express.