Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making it simpler to use multiple OneWire buses with an arduino array #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

prashantdev
Copy link

I'm a novice at C, so feel free to correct my SNAFUs.

Prashant added 2 commits October 19, 2014 22:36
…lify

multiple OneWire buse use, allowing for easier construction of arrays of OneWire buses,
in the limited environment provided by Arduino.
See the Multibus_simple example illustrating a use-case of the extension.
int oneWirePins[]={3,7};//OneWire DS18x20 temperature sensors on these wires
const int oneWirePinsCount=sizeof(oneWirePins)/sizeof(int);

OneWire ds18x20[oneWirePinsCount];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line gives me this error:

Multibus_simple:8: error: no matching function for call to 'OneWire::OneWire()'
 OneWire ds18x20[oneWirePinsCount];
                                 ^

I guess because there is no constructor that takes an array as argument?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wait, I got a bit confused there... This example is for the DallasTemperature.h lib... And is already merged there... However, since this change was never merged into this library, that example won't work with the official version of this library.

Another error I'm getting:

Multibus_simple:23: error: 'class OneWire' has no member named 'setPin'
     ds18x20[i].setPin(oneWirePins[i]);
                ^

@JoakimSoderberg
Copy link

@ntruchsess Please look at this Pull Request

@prashantdev
Copy link
Author

Joakim: since ntruchsess has not updated thearduino-OneWire library in the
past 3 years, you may directly use my fork, which is only a shade under a
year, and thus, up-to-date.

On Sat, Dec 26, 2015 at 10:35 PM, Joakim Söderberg <notifications@github.com

wrote:

@ntruchsess https://github.com/ntruchsess Please look at this Pull
Request


Reply to this email directly or view it on GitHub
#2 (comment)
.

@JoakimSoderberg
Copy link

@prashantdev yea I know, are you planning on keeping on maintaining the lib? I just want this stuff to be in the "official" version of the lib. It sucks if people have to go hunt for some special version of a lib to get things to work. But I guess this is normal in the arduino community, where most sketches are copy and paste, it just irks me :)

Hmm but now I read the comment in the header, and see that https://github.com/PaulStoffregen/OneWire is the "real" version. And that this one is just a fork.... So yea, very confusing. Not to mention the Wire.h that comes with the Arduino release. So I'd suggest you fork his repo and do your PR towards that instead.

@ntruchsess If you have abandoned this fork, I think it would be nice to link to https://github.com/PaulStoffregen/OneWire and mark this repository as dead.

@prashantdev
Copy link
Author

This problem is occurring because Mikes Burton has implemented my changes
in arduino temperature control library, but OneWire is still not updated.
On Dec 27, 2015 4:37 PM, "Joakim Söderberg" notifications@github.com
wrote:

@prashantdev https://github.com/prashantdev yea I know, are you
planning on keeping on maintaining the lib? I just want this stuff to be in
the "official" version of the lib. It sucks if people have to go hunt for
some special version of a lib to get things to work. But I guess this is
normal in the arduino community, where most sketches are copy and paste, it
just irks me :)

Hmm but now I read the comment in the header, and see that
https://github.com/PaulStoffregen/OneWire is the "real" version. And that
this one is just a fork.... So yea, very confusing. Not to mention the
Wire.h that comes with the Arduino release. So I'd suggest you fork his
repo and do your PR towards that instead.

@ntruchsess https://github.com/ntruchsess If you have abandoned this
fork, I think it would be nice to link to
https://github.com/PaulStoffregen/OneWire and mark this repository as
dead.


Reply to this email directly or view it on GitHub
#2 (comment)
.

@prashantdev
Copy link
Author

prashantdev commented Dec 27, 2015 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants