Quote Originally Posted by silentwol View Post
Hi,

This is done using a hardware PWM on GPIO.2 and then making IO.1 high/low to form a signal. The two are then combined using a two transistor AND gate which powers the LED.
Not directly related to your question, but concerning transmitting of an IR signal; here's my experience. I had in the past tried pretty much what you are doing (hardware PWM on one pin, and the data on another). I then modified the code to control the PWM itself as per the data bits, and got a much better sinal (in terms of shape and amplitude). So much so that I could even get rid of the transistor, and drive the LED directly (in series with a resistor) from the pin. Additional bonus being saved an IO pin as well.


Regards,

Anand Dhuru