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

The Multibus_simple.ino example does not work #47

Closed
JoakimSoderberg opened this issue Dec 26, 2015 · 8 comments
Closed

The Multibus_simple.ino example does not work #47

JoakimSoderberg opened this issue Dec 26, 2015 · 8 comments

Comments

@JoakimSoderberg
Copy link
Contributor

Note that the example https://github.com/milesburton/Arduino-Temperature-Control-Library/blob/master/examples/Multibus_simple/Multibus_simple.ino does not work unless you have changes in OneWire.h that is not yet merged in that lib.

Specifically this Pull Request has not yet been merged:
ntruchsess/arduino-OneWire#2

@JoakimSoderberg JoakimSoderberg changed the title The The Multibus_simple.ino example does not work Dec 27, 2015
@JoakimSoderberg
Copy link
Contributor Author

Ok, I now realise that the mentioned repository I linked to is not the official one. The arduino lib community is very confusing :(

As I understand it, this is the official repository: https://github.com/PaulStoffregen/OneWire

But the issue still applies. The example requiers the changes by @prashantdev in OneWire.h to work

@2mik
Copy link

2mik commented Feb 6, 2016

The reason that OneWire class does not contain a default parameterless constructor and setPin method. I think Multibus_simple.ino is outdated

@2mik
Copy link

2mik commented Feb 6, 2016

I've started the example after the following changes:
//int oneWirePins[]={3,7};//OneWire DS18x20 temperature sensors on these wires
//const int oneWirePinsCount=sizeof(oneWirePins)/sizeof(int);

#define ONE_WIRE_BUS0 2
#define ONE_WIRE_BUS1 3
#define ONE_WIRE_BUS2 4

const int oneWirePinsCount = 3;

//OneWire ds18x20[oneWirePinsCount];
OneWire oneWire0(ONE_WIRE_BUS0);
OneWire oneWire1(ONE_WIRE_BUS1);
OneWire oneWire2(ONE_WIRE_BUS2);
OneWire ds18x20[] = {oneWire0, oneWire1, oneWire2};
DallasTemperature sensor[oneWirePinsCount];

...

//ds18x20[i].setPin(oneWirePins[i]);

@prashantdev
Copy link

The whole reason for my writing this code (and the empty constructor) is to
have exactly one place to make a change in sensors - add a new sensor,
change a pin, remove a sensor. Change in one place, and don't worry about
code breaking elsewhere.

So, while I could have started out by doing what you did, my liking for a
better/cleaner code forced me to update OneWire. Multibus_simple derives
from my attempt to write better code in my .ino files.

On Sat, Feb 6, 2016 at 11:59 PM, 2mik [email protected] wrote:

I've started the example after the following changes:
#include
#include

//int oneWirePins[]={3,7};//OneWire DS18x20 temperature sensors on these
wires
//const int oneWirePinsCount=sizeof(oneWirePins)/sizeof(int);

#define ONE_WIRE_BUS0 2
#define ONE_WIRE_BUS1 3
#define ONE_WIRE_BUS2 4

const int oneWirePinsCount = 3;

//OneWire ds18x20[oneWirePinsCount];
OneWire oneWire0(ONE_WIRE_BUS0);
OneWire oneWire1(ONE_WIRE_BUS1);
OneWire oneWire2(ONE_WIRE_BUS2);
OneWire ds18x20[] = {oneWire0, oneWire1, oneWire2};
DallasTemperature sensor[oneWirePinsCount];


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

@2mik
Copy link

2mik commented Feb 7, 2016

Thank you for the very usefull library

@milesburton
Copy link
Owner

Closing issue for now. Feel free to reopen if any new information appears

@Bouffski
Copy link

Bouffski commented Sep 6, 2016

@2mik Would it be possible to publish the complete -revised- example sketch? I have two 1820's, one is recognized, the other isn't...
And me knowledge is just (too) little... (and not only on this subject, helas)
BTW thank you very very much, I'm almost home!
And, can u give me a hint about the pull up resistors? Could that be the problem?
Always good to answer ones own questions... And yes the Resistor 4k7 between Pin and 5Volts did the job, i.c. was the problem... Now I'm home!
Cheers

@2mik
Copy link

2mik commented Sep 7, 2016

Oh, it was so far ago, sorry.
May be my project that uses this library, helps you. See the link

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

No branches or pull requests

5 participants