Forum Rule: Always post complete source code & details to reproduce any issue!

Search:

Type: Posts; User: defragster

Search: Search took 0.01 seconds.

  1. Replies
    31
    Views
    9,898

    Oh … remembering that missing .end() code now …...

    Oh … remembering that missing .end() code now … Teensy-4-FreqCount-compile-error

    I didn't run the p#25 code - was just looking to see how 'delayMicroseconds(40);' was the fix … it is that and then...
  2. Replies
    31
    Views
    9,898

    Looks like this part - where 40us delay is just...

    Looks like this part - where 40us delay is just the start:


    FreqMeasure.begin();
    delayMicroseconds(40);
    // dummy meas 1
    delay(fmd);
    fmea:
    nm = FreqMeasure.available();
    if (!nm)...
  3. Replies
    31
    Views
    9,898

    Ideally there is a CORES LIB fix in the waiting...

    Ideally there is a CORES LIB fix in the waiting here … but … can you show code that does that?

    When I was coding before the p#21 code it was tried with delayMicroseconds() as high as 105 and it...
  4. Replies
    31
    Views
    9,898

    Here is complete code that exhibits the issue and...

    Here is complete code that exhibits the issue and shows HACK to hide the break after .begin()



    SIMILAR thread: pjrc.com/threads/58062-FreqCount-caution

    The FreqCount exhibits similar startup...
  5. Replies
    31
    Views
    9,898

    I find code like this actually resolves the...

    I find code like this actually resolves the issue:

    FreqMeasure.end();
    FreqMeasure.begin();
    {
    while (!FreqMeasure.available());
    int yy = 0;
    while...
  6. Replies
    31
    Views
    9,898

    Making this edit to post #15 loop() code shows...

    Making this edit to post #15 loop() code shows the trouble with .end() then .begin():


    void loop() {
    for ( int ii = 0; ii < ASET; ii++ ) {
    while (!FreqMeasure.available());
    ...
  7. Replies
    31
    Views
    9,898

    This does show the first reading is wrong with...

    This does show the first reading is wrong with the initial value set :: capture_previous=0 :: With that then factoring into first reading.

    The code handles various timer types - not sure if...
  8. Replies
    31
    Views
    9,898

    @analog&RFmodels and @mjs513 … Paul? First...

    @analog&RFmodels and @mjs513 … Paul?

    First note is that the initial prints were being LOST without the while(!Serial); in setup().

    Getting that resolved and putting .begin() at Setup() end that...
  9. Replies
    31
    Views
    9,898

    Numbers above are right - but only reading from...

    Numbers above are right - but only reading from non-empty queue.

    This code catches queue empty and then after delay empties it as ordered:

    #include <FreqMeasure.h>

    void setup() {
    ...
  10. Replies
    31
    Views
    9,898

    it only takes 6 to 8 microseconds to determine...

    it only takes 6 to 8 microseconds to determine the count it seems using this code:

    #include <FreqMeasure.h>

    void setup() {
    Serial.begin(9600);
    analogWriteFrequency(23, 18000); // test...
  11. Replies
    31
    Views
    9,898

    Interesting - as noted : "not sure of the...

    Interesting - as noted : "not sure of the mechanics of the counting timing involved"

    If those two first parts {6578+3179 = = 9757 } are added they almost account for a full count over a cycle time...
  12. Replies
    31
    Views
    9,898

    Glad you saw it work - not sure of the mechanics...

    Glad you saw it work - not sure of the mechanics of the counting timing involved - and how .begin .end would mess with that - but is seemed possible or likely. Not surprising the M0 T_LC is a bit...
  13. Replies
    31
    Views
    9,898

    Yes, as in the post #2 example from the IDE...

    Yes, as in the post #2 example from the IDE install - setup() begin() is normal IDE format.

    Code could to do this and then just rename main when sharing and use the setup() and loop() funcs -...
  14. Replies
    31
    Views
    9,898

    Typical for forum sketches to be in IDE format to...

    Typical for forum sketches to be in IDE format to allow actually running the code unchanged.

    Why the repeated :: { .begin, .end, .begin , … }

    This examples shows intended usage to some degree...
Results 1 to 14 of 14