Hi,
I have a question about OneWire (
http://www.pjrc.com/teensy/td_libs_OneWire.html) library. Documentations and examples says that I have to define pin nr to create OneWire object in sketch header. Is it possible to define OneWire pin dynamically?
#include <OneWire.h>
/* DS18S20 Temperature chip i/o */
OneWire ds(10); // on pin 10
void setup(void) {
Serial.begin(9600);
}
For conclusion I need to define and read OneWire pin nr-s from EEPROM. I'll write OneWire pin nr over serial into EEPROM and every time Arduino should take pin nr from EEPROM and use it. It does not matter if EEPROM reading takes in loop or in setup functions. Can someone give some hints or explain how to release this idea of using dynamic pin selector.
Many thanks.