Need info on X10.h library

I have an Adruino Uno and I just got a PL513. I downloaded the X10.h library but I can't find the syntax of all the commands or list of commands (i.e. x10.beginTransmission, x10.write, x10.endTransmission, etc).

Since no one else has asked this question I assume I just must be missing something simple. So please tell me where I can find this. Thanks.

Hi, (You DID read this, right?) :

There doesn't seem to be a standard or guideline for this issue. (Anyone have pointers?)

Many nicely done libraries have an information page or if on GitHub etc, a WIKI that starts with How-To.

But many times all you can do is read the .H file in wordpad etc. and look for stuff like:

CommandCode { cmdOn, cmdOff, cmdBright, cmdDim }; Telling you the possible commands.

More gory is to read the .cpp files and figure out by the coding what the author meant to do.

I found this example in a book but it doesn’t work, I get a “X10 does not name a type” error. I don’t know enough about instances and libraries and the like to figure it out but I will keep looking at examples and I am sure I will figure it out.

// x10 pl513 controller

#include <x10.h>
#include <x10constants.h>

#define rxPin 7
#define zcPin 9
#define dataPin 8
#define repeatTimes 1

x10 myHouse = x10.begin(rxPin, dataPin, zcPin); // line with error

 void setup() {

  myHouse.write(C, ALL_UNITS_OFF, repeatTimes);

void loop()  {

  myHouse.write(C,UNIT_1, repeatTimes);
  myHouse.write(C, ON, repeatTimes);
  myHouse.write(C,UNIT_1, repeatTimes);
  myHouse.write(C, OFF, repeatTimes);

Where did you put the library? It may simply be that the IDE can't find it.

I got the X10 library from here…

Here is another example code I found on this site and supposedly works. But I get the same error - “X10’ does not name a type”. Could it be something wrong with my PC? I am using the 1.0.2 ver of the IDE.

#include <x10constants.h>
#include <x10.h>

#define ZCROSS_PIN        2        // BLK or Yel pin 1 of TW523
#define RCVE_PIN        4       // GRN or RED  pin 3 of TW523
#define TRANS_PIN        5       // YEL or BLK pin 4 of TW523
#define LED_PIN        13       // state pin for testing 

x10 SX10= x10(ZCROSS_PIN,TRANS_PIN,RCVE_PIN,LED_PIN);//error flagged here

void setup(){

void loop(){
  myHouse.write(A, UNIT_1, 3);
  myHouse.write(A, OFF, 3);
  myHouse.write(B, UNIT_1, 3);
  myHouse.write(B, OFF, 3);
  myHouse.write(C, UNIT_1, 3);
  myHouse.write(C, OFF, 3);

But I get the same error - "X10' does not name a type". Could it be something wrong with my PC? I am using the 1.0.2 ver of the IDE.

MeToo on 0023 and 1.03

This link may shed some light on this. All the examples I have found are old. Seems like in 2012 when 1.0.1 came out it broke the x10 library. Still looking into this. I found an x10ex library, maybe I can use that.

OK,the library and examples here:

compile OK for me on 1.03. Have not tested functionality...

Thanks, that is the one I found. I will try it when I get home. Not sure if it works the same as x10.h or if it works with my PL513. We'll see.

Cant get the x10ex library to work, maybe because I am using the PL513. So I sent an email to Tom I. who wrote the x10.h lib to see what he says about the error with x10.h.

For what it’s worth, I’ve tested my version of the X10 library on everything from 1.0 through 1.0.3 and it works fine. I get occasional mails about it, and most of the problems seem to center on a few issues:

  1. libraries installed incorrectly. For this, check that you have libraries installed correctly. That’s usually the answer to 99% of the mails I get.

  2. doesn’t work with pre-1.0. I didn’t make it backwards-compatible, sorry.

  3. doesn’t work with all X10 units. I don’t own anything but the ones I tested it with. So I can’t say.

  4. doesn’t do read. I have not had time or need to implement read, but others have. I recommend searching out some of the other X10 libs if you need read.

I check with each version of Arduino to make sure the code is intact, and that it compiles and works with my units, but I haven’t actually implemented a new X10 project since 2010. It’s not a protocol I use much anymore. X10’s always been a bit flaky for me, even when the library’s been working perfectly, So I haven’t had time to improve this library. If I were doing home automation projects right now, I’d look into other alternatives. I find the Philips Hue, the Wemo, and the PowerSwitchTail to be more useful for things around the house, for me. They don’t have the main limitation that X10 does, not being able to send data across different circuits in my home. Every time I’ve used X10, I’ve had to ensure that the devices are on the same circuit breaker.

Hope that’s helpful in some way.

Thanks Tom for your reply. But unfortunately, that was not the problem. I completely deleted all the Arduino software and downloaded and installed 1.0.3 and re-downloaded the X10h zip file and re-installed it. But I still get the same error as before. Running your X10Blink programs compiles OK but does not run. It hangs on the x10.write command. I am about to give up on the x10 library.

If you got it to compile, you're at the same state as me today. I don't have any X10 gear at home, so I can't test further.

I have some notes in "Making Things Talk" as to the hardware hiccups you're likely to hit beyond the library. In summary, they amount to:

  • Make sure your modem and devices are on the same AC circuit. X10 won't get past the circuit breaker
  • Once you've uploaded working code, unplug the modems and reset the Arduino. The modems are sensitive to timing disruptions. I found I can seldom get code to run without re-plugging while I'm developing, but once I have stable code, I can reset everything and it'll run reasonably well, as long as they're all on the same circuit
  • Check your house codes, etc. to make sure you're sending to the right device and right group
  • Make sure your code sends infrequently. Sending every time through the main loop will make a horrible mess, as the modem's only sending 120 bits a second, on the zero crossing, or 100 bits a second in Europe

Honestly, leaving X10 behind is probably not a bad idea. As I said, I have always found X10 to be troublesome. I wanted to delete it from the last version of "Making Things Talk" but there had been enough to keep it that I did, and updated the library. I've never intended that library to be a final version, and many others have made their own. Check out John Giametti or Doug Clinton's work for more, sorry I don't have their latest links but they are google-able.

If you want a more flexible home automation system, look into more modern alternatives like WeMo, Power line interfaces (I saw some from NetGear in the BestBuy store earlier today), or build your own with XBees and PowerSwitchTails, or your own relays.


Thanks Tom!!!!! I did a search on Doug's library and downloaded it. I did not get the compile error. But it still didn't work. As a last resort I switch the zc and data pins around and it worked. I know I had the plug wired correctly between the PL513 and the Arduino. All I can think of is inside the phone cable I am using they switch 2 wires around. Anyway I am very happy now.

Regarding what you said about the X10, I have been using X10 for 25 years and my whole house is using it. I got alot of spare modules around and it works good for me. Many years ago I installed the X10 capactior which coupled both phases of my 220 in my house so I have no problem sending a signal from one socket to any other in ther house.

My next step is my ultimate goal, to control the X10 from the net using the Arduino. That is a piece of cake compared to getting the X10 to be controled by the Arduino. 8-)


hi All - Joe - Doug is hosting a version of my library (based on Tom's and Brohogan's code) at

We're discussing more permanent hosting options, but for now, this version is stable on the current Arduino version.

Despite much investment in time and materials, whole house couplers, repeater/amplifiers, I was never able to make the original X10 reliable (enough) in my house and have set it aside. My opinion is that it's era is over. If/when I reengage it will be with a more modern standard. I'm impressed you've made it reliable!


Yea, Doug's library worked and I would like to see a reference to it on the Arduino X10 page for people like me who couldn't get it Tom's original library to work and who don't know enough C++ and library coding to troubleshoot it.

It has not been easy getting X10 to work. Besides the coupler capacitor I needed to install X10 filters for all my computers as they all tend to kill the X10 signals. And I still have a stray outlet that does not work. I know it is not the best system and of course it is like 30 years old now. But like I said I have almost every kind of X10 module every made. It would cost me way to much to replace. And since I have not really done anything with X10 in a long time, I am not even sure what has replaced it. All I know is most places don't sell it anymore and the modules are getting harder to fine. Maybe I will be force to upgrade sometime in the future. Thanks for your post.