A place for the self-complicating thoughts of Brett Hagman
Lofty Premises
  • Home
  • Noise
  • Showcase
  • Libraries
    • Tone
    • SoftPWM
    • MillisTimer
    • RogueSD
    • RogueMP3
    • Button
  • Workshops
    • Getting Started with Wiring and Arduino
    • Learn to Solder
  • Wiring

Low Frequencies on Arbitrary Pins

7/23/2014

0 Comments

 
I've had a few people ask me how to produce low frequencies on an arbitrary Arduino/Wiring pin. They have found that the tone() function (the same applies to the Tone library) can not produce frequencies below ~30 Hz.

The thing is that when you're toggling a pin at that frequency, it is essentially an eon between pin toggles (from the microcontroller's perspective).

So my suggestion is to add non-blocking code in your main loop to handle the flips, just as long as you don't tie up the main loop with too much other time-consuming code.

Here is a capture of the frequency output from a Wiring S: 
Picture
0 Comments



Leave a Reply.

    Author

    The author of this blog is... well, it depends.  It could be the right side or the left side of Brett Hagman's brain - which ever one happens to be working at the time.

    View my profile on LinkedIn

    Archives

    January 2017
    November 2016
    November 2014
    July 2014
    January 2014
    October 2013
    September 2013
    August 2013

    Categories

    All
    Arduino
    Code
    Flotsam
    GHGist
    Google
    Grammar
    Halloween
    Howtrue
    Pedantic
    Reblog
    Timewasted
    Wiring
    Workshop

    RSS Feed

Powered by Create your own unique website with customizable templates.