Simple Infrared PWM on Arduino

56kHz-50-percent

The crew from AnalysIR has written up an article on Simple Infrared PWM on Arduino. This first part of a series will show you how to generate the simple Infrared carrier frequency on Arduino:

We are often asked on discussion boards, about conflicts between IRremote or IRLib and other Arduino Libraries. In this post, we present a sketch for ‘Simple Infrared PWM on Arduino’. This is the first part in a 3 part series of posts. Part 1 shows how to generate the simple Infrared carrier frequency on Arduino, using any available IO pin and without conflicting with other libraries. Part 2 will show how to send a RAW infrared signal using this approach and Part 3 will show how to send a common NEC signal from the binary or HEX value

Join the Conversation

4 Comments

  1. Yeah, yeah, the old change state then delay loop trick.
    This dinosaur asks: Is there any Arduino user who’d move to C/C++ to get proper things done rather than continue with simple coding loops?
    (This is not meant to inflame, rather, such Arduino code always seems… disappointing to me.)

    1. Why do things proper if they work cheap and dirty?

      For trying a concept (“Does it work?”) I often start with something very simple. Outlining the idea, fishing for problems, limitation etc. The about example looks like such a “proof of concept” to me.

      If it works I start to refactor it into something nicer. And depending of payment (Most customers don’t pay for “beauty of code”) and need, it is refactored multiple times…

      (I don’t see so much different between Wiring/Arduino and C/C++ beside the hassle with stupid make systems, prototypes and f*cking forwards and such…)

    2. “Is there any Arduino user who’d move to C/C++ to get proper things done”
      I suspect the answer is “not really”, as in “hardly ever”. The biggest problem with the Arduino is that even though it almost never actually works properly and takes away orders of magnitude of the performance the hardware is actually capable of, 99% of the time it just sort-of-works as-is. In our brave new world where in computing guaranteed unreliability and large-scale pissing away of resources is the accepted way to do things (“just get bigger/better/faster/more/newer hardware”), nobody wonders anymore what the problem might be with that. Unless you’ve experienced otherwise yourself, in which case it becomes unbearable – everybody else seems content with the status quo though.

Leave a comment

Your email address will not be published. Required fields are marked *

Notify me of followup comments via e-mail. You can also subscribe without commenting.