Skip to main content
Arduino

Return to Question

Copy edited (e.g. ref. <https://en.wikipedia.org/wiki/Hertz#SI_multiples> and <http://english.stackexchange.com/questions/15953>). Used more standard formatting (but do those numbers really need emphasis?).
Source Link

Is it possible to generate an exact 15kHz15 kHz clock pulse using an Arduino?

I want to generate a 15kHz15 kHz pulse with an Arduino using Timer1, but the problem is that if we want a 15000Hz15000 Hz clock we need to initialize the timer with 1/150001/15000 seconds or 66.6666.66 microseconds, but we can only pass integers without any decimal precision in the Timer1.initialize(66); function which generates a frequency of 15155Hz15155 Hz.

So is it possible by any other means to generate an exact 15000Hz15000 Hz or frequencies between 15000Hz - 15155Hz15000 Hz - 15155 Hz?

#include <TimerOne.h>
void setup() {
 pinMode(9,OUTPUT);
 Timer1.initialize(66); // Frequency, 100us100 μs = 10khz10 kHz
 Timer1.pwm(9,255);
}
 
void loop() {}

Is it possible to generate an exact 15kHz clock pulse using an Arduino?

I want to generate a 15kHz pulse with an Arduino using Timer1, but the problem is that if we want a 15000Hz clock we need to initialize the timer with 1/15000 seconds or 66.66 microseconds but we can only pass integers without any decimal precision in the Timer1.initialize(66); function which generates a frequency of 15155Hz.

So is it possible by any other means to generate an exact 15000Hz or frequencies between 15000Hz - 15155Hz?

#include <TimerOne.h>
void setup() {
 pinMode(9,OUTPUT);
 Timer1.initialize(66); // Frequency, 100us = 10khz
 Timer1.pwm(9,255);
}
 
void loop() {}

Is it possible to generate an exact 15 kHz clock pulse using an Arduino?

I want to generate a 15 kHz pulse with an Arduino using Timer1, but the problem is that if we want a 15000 Hz clock we need to initialize the timer with 1/15000 seconds or 66.66 microseconds, but we can only pass integers without any decimal precision in the Timer1.initialize(66); function which generates a frequency of 15155 Hz.

So is it possible by any other means to generate an exact 15000 Hz or frequencies between 15000 Hz - 15155 Hz?

#include <TimerOne.h>
void setup() {
 pinMode(9,OUTPUT);
 Timer1.initialize(66); // Frequency, 100 μs = 10 kHz
 Timer1.pwm(9,255);
}
 
void loop() {}
Tweeted twitter.com/StackArduino/status/1352133850193928193
Became Hot Network Question
Formatted code, minor editorial stuff.
Source Link
ocrdu
  • 1.8k
  • 3
  • 12
  • 24

Is it possible to generate an exact 15kHz clock pulse in arduinousing an Arduino?

I want to generate a 15kHz pulse with arduinoan Arduino using Timer1, but the problem is that if we needwant a 15000Hz clock we need to initialize the timer with 1/15000 seconds or 66.66 microseconds but we can only pass integers without any decimal precision in the Timer1.initialize(66); function which is generatinggenerates a frequency of 15155Hz.

So is it possible by any other means to generate an exact 15000Hz or frequencies between 15000Hz - 15155Hz?

#include <TimerOne.h>
void setup()
{
pinMode(9,OUTPUT);
Timer1.initialize(66); // Frequency, 100us = 10khz
Timer1.pwm(9,255);
}
 
void loop()
{
}
#include <TimerOne.h>
void setup() {
 pinMode(9,OUTPUT);
 Timer1.initialize(66); // Frequency, 100us = 10khz
 Timer1.pwm(9,255);
}
 
void loop() {}

Is it possible to generate exact 15kHz clock pulse in arduino?

I want to generate 15kHz pulse with arduino using Timer1 but the problem is that if we need 15000Hz clock we need to initialize the timer with 1/15000 seconds or 66.66 microseconds but we can only pass integers without any decimal precision in the Timer1.initialize(66); function which is generating a frequency of 15155Hz.

So is it possible by any other means to generate exact 15000Hz or frequencies between 15000Hz - 15155Hz

#include <TimerOne.h>
void setup()
{
pinMode(9,OUTPUT);
Timer1.initialize(66); // Frequency, 100us = 10khz
Timer1.pwm(9,255);
}
 
void loop()
{
}

Is it possible to generate an exact 15kHz clock pulse using an Arduino?

I want to generate a 15kHz pulse with an Arduino using Timer1, but the problem is that if we want a 15000Hz clock we need to initialize the timer with 1/15000 seconds or 66.66 microseconds but we can only pass integers without any decimal precision in the Timer1.initialize(66); function which generates a frequency of 15155Hz.

So is it possible by any other means to generate an exact 15000Hz or frequencies between 15000Hz - 15155Hz?

#include <TimerOne.h>
void setup() {
 pinMode(9,OUTPUT);
 Timer1.initialize(66); // Frequency, 100us = 10khz
 Timer1.pwm(9,255);
}
 
void loop() {}
Source Link
astrick
  • 193
  • 1
  • 9

Is it possible to generate exact 15kHz clock pulse in arduino?

I want to generate 15kHz pulse with arduino using Timer1 but the problem is that if we need 15000Hz clock we need to initialize the timer with 1/15000 seconds or 66.66 microseconds but we can only pass integers without any decimal precision in the Timer1.initialize(66); function which is generating a frequency of 15155Hz.

So is it possible by any other means to generate exact 15000Hz or frequencies between 15000Hz - 15155Hz

#include <TimerOne.h>
void setup()
{
pinMode(9,OUTPUT);
Timer1.initialize(66); // Frequency, 100us = 10khz
Timer1.pwm(9,255);
}
 
void loop()
{
}
lang-cpp

AltStyle によって変換されたページ (->オリジナル) /