Condor Pasa
New member
Hello,
I hacked Paul's example code to measure 4ea frequencies (motor speeds) and it works great! My question is about freq5 below. It's measuring a pulse width with
a Teensy 3.5 at 120MHz but the read from freq5 below is at a 60MHz rate. Am I missing something?
Shouldn't it be reading is at a 120MHz instead of 60MHz? It also works great assuming it runs at 60MHz.
freq1.begin(5);
freq2.begin(6);
freq3.begin(9);
freq4.begin(10);
freq5.begin(20,FREQMEASUREMULTI_MARK_ONLY);
while (!SD.begin(chipSelect)) {}
}
//**************************************************************
//**************************************************************
//*********************** LOOP FUNCTION **********************
//**************************************************************
//**************************************************************
void loop() {
//********************************
//Step 01 Measure frequency's
//********************************
if (freq1.available()) {
sum1 = sum1 + freq1.read();
count1 = count1 + 1;
}
if (freq2.available()) {
sum2 = sum2 + freq2.read();
count2 = count2 + 1;
}
if (freq3.available()) {
sum3 = sum3 + freq3.read();
count3 = count3 + 1;
}
if (freq4.available()) {
sum4 = sum4 + freq4.read();
count4 = count4 + 1;
}
if (freq5.available()) {
sum5 = sum5 + freq5.read();
count5 = count5 + 1;
// CH7 = freq5.read();
}
I hacked Paul's example code to measure 4ea frequencies (motor speeds) and it works great! My question is about freq5 below. It's measuring a pulse width with
a Teensy 3.5 at 120MHz but the read from freq5 below is at a 60MHz rate. Am I missing something?
Shouldn't it be reading is at a 120MHz instead of 60MHz? It also works great assuming it runs at 60MHz.
freq1.begin(5);
freq2.begin(6);
freq3.begin(9);
freq4.begin(10);
freq5.begin(20,FREQMEASUREMULTI_MARK_ONLY);
while (!SD.begin(chipSelect)) {}
}
//**************************************************************
//**************************************************************
//*********************** LOOP FUNCTION **********************
//**************************************************************
//**************************************************************
void loop() {
//********************************
//Step 01 Measure frequency's
//********************************
if (freq1.available()) {
sum1 = sum1 + freq1.read();
count1 = count1 + 1;
}
if (freq2.available()) {
sum2 = sum2 + freq2.read();
count2 = count2 + 1;
}
if (freq3.available()) {
sum3 = sum3 + freq3.read();
count3 = count3 + 1;
}
if (freq4.available()) {
sum4 = sum4 + freq4.read();
count4 = count4 + 1;
}
if (freq5.available()) {
sum5 = sum5 + freq5.read();
count5 = count5 + 1;
// CH7 = freq5.read();
}