Skip to content

Average interference with I2C ? #4

Description

@samtal

Hello,
I recently found the Average class, and decided to try it out (to make my long program look shorter and easy to maintain).
It seem to have several nice features that I can use with thanks.

I replaced my several self built moving average (runs nicely, but not proof) with the Average class 'rolling' in several locations within my Arduino Mega.
Unfortunately, while it compiles nicely, in actual run with the Arduino I receive I2C "read nack on transmit of address". This error is also shown with previous version of my program that does not use the Average, and has no Average include, but problem is gone if I remove the Average.h file from the Arduino library.
In simple words: The pretense alone of the class Average (with the Wire class??) cause the problem

To me, analysis of the problem seems quite complex, thus before trying going deep into it (or abandoning the Average), I prefer asking the 'Average' experts.

Looks like there is some interference of the Average class and the Wire even if the Wire is not included, but is present in the lib. (There are unfortunately several versions of Wire)
I wonder why use 'get' and 'push' as Average commands, while those two words are common keywords that are used internally with many programs. Can this be the reason?

Here are my includes:

include "PID_v1.h"

include "Wire.h"

include "Streaming.h"

include "EEPROM.h"

include "LiquidCrystal.h"

include "Average.h"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions