Don't know the X-10 lib, but an educated guess is that they share some resource e.g. SPI pins?
Ethernet-shield uses pin 10 -13 (10 = Slave Select) No two SPI devices may be selected at the same time, don't know what the X-10 lib does,
but as the libs are open source you could dive into the code to see...
robtillaart:
Don't know the X-10 lib, but an educated guess is that they share some resource e.g. SPI pins?
Ethernet-shield uses pin 10 -13 (10 = Slave Select) No two SPI devices may be selected at the same time, don't know what the X-10 lib does,
but as the libs are open source you could dive into the code to see...
Thanks for your information.
When I look at the codes,
EthernetDHCP library calls SPI.h (#include <SPI.h>), but X10 dose not include SPI.h. In this case, can I say X10 libaray does not use SPI? Or do I have to look at the library?
Can you let me know which specific parts of codes indicate that it uses SPI?
I don't see any SPI in the X10 files. But this may be the problem, as robtillaart suggested:
x10::x10(int zeroCrossingPin, int dataPin)
{
this->zeroCrossingPin = zeroCrossingPin; // the zero crossing pin
this->dataPin = dataPin; // the output data pin
// Set I/O modes:
pinMode(this->zeroCrossingPin, INPUT);
pinMode(this->dataPin, OUTPUT);
}
When you call x10(x,y), what are those values? In the examples I found, it is pins 2 and 3.
It may be memory, but for certain you can't use pin 10 for x10. That is the SPI enable/disable pin for the ethernet SPI interface.
2 and 3 would be best.
What does the compiler report for memory when it finished compiling your code?
SurferTim:
It may be memory, but for certain you can't use pin 10 for x10. That is the SPI enable/disable pin for the ethernet SPI interface.
2 and 3 would be best.
What does the compiler report for memory when it finished compiling your code?
When I compile the codes, it shows that
'Binary sketch size: 14726 bytes (of a 32256 byte maximum)'
So, I have just turned back to the beginning to make sure the whole process, I'm wiring stuffs again.