I would like to generate 4 square signals of different frequencies below 30 hz using timers of Arduino Mega.

I was able to generate 30.6hz signals but I have no idea how to generate lower frequencies.

Any help would be appreciated.

  • Yes, you can use PWM with timer. Take a look to this guide: arduino.cc/en/Tutorial/SecretsOfArduinoPWM – leoc7 Jan 18 at 9:00
  • How low? lower than 1Hz? Is it without pwm, just a 50% square wave? How accurate should be frequency be? Should the signal be very steady or is a software (with or without interrupt) also possible. I assume there is a library that can use all the timers of the arduino mega, but I could not find it yet. Please also tell us what your project is for. – Jot Jan 18 at 10:13
  • 30.6 Hz is the slowest you can get from an 8 bit timer. For lower frequencies, you will have to use 16 bit timers. – Edgar Bonet Jan 18 at 20:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.