Arduino/Libraries/x10/x10.cpp
/*
	Writes an X10 command out to the X10 modem
*/
Writes an X10 command out to the X10 modem
Writes an X10 command out to the X10 modem
void x10::write(byte houseCode, byte numberCode, byte numRepeats)
{
	byte startCode = B1110; 	
 	for (uint8_t i = 0; i < numRepeats; i++) {
 		sendBits(startCode, 4, true);	
  		sendBits(houseCode, 4, false);
  		sendBits(numberCode, 5, false);
  	}
  	if ((numberCode != BRIGHT) && (numberCode != DIM)) {
 		for (uint8_t i = 0; i < 6; i++) {
  			waitForZeroCross();
		}
  	}
}
void x10 :: write ( byte houseCode , byte numberCode , byte numRepeats ) { byte startCode = B1110 ; for ( uint8_t i = 0 ; i < numRepeats ; i ++ ) { sendBits ( startCode , 4 , true ) ; sendBits ( houseCode , 4 , false ) ; sendBits ( numberCode , 5 , false ) ; } if ( ( numberCode != BRIGHT ) && ( numberCode != DIM ) ) { for ( uint8_t i = 0 ; i < 6 ; i ++ ) { waitForZeroCross ( ) ; } } }
Writes an X10 command out to the X10 modem
Writes an X10 command out to the X10 modem
// every X10 command starts with this // repeat as many times as requested: // send the three parts of the command: // if this isn't a bright or dim command, it should be followed by // a delay of 3 power cycles (or 6 zero crossings):