Arduino/Libraries/x10/x10.cpp
/*
 Constructor.
 
 Sets the pins and sets their I/O modes.
 
 */
Constructor.
Sets the pins and sets their I/O modes.
Constructor . Sets the pins and sets their I / O modes .
x10::x10(uint8_t zeroCrossingPin, uint8_t dataPin)
{
	this->dataPin = dataPin;		
	zeroCrossingReg = portInputRegister(digitalPinToPort(zeroCrossingPin));
	zeroCrossingBit = digitalPinToBitMask(zeroCrossingPin);
	#ifdef INPUT_PULLUP
	pinMode(zeroCrossingPin, INPUT_PULLUP);
	#else
	pinMode(zeroCrossingPin, INPUT);
	digitalWrite(zeroCrossingPin, HIGH);
	#endif
	pinMode(dataPin, OUTPUT);
}
x10 :: x10 ( uint8_t zeroCrossingPin , uint8_t dataPin ) { this -> dataPin = dataPin ; zeroCrossingReg = portInputRegister ( digitalPinToPort ( zeroCrossingPin ) ) ; zeroCrossingBit = digitalPinToBitMask ( zeroCrossingPin ) ; #ifdef INPUT_PULLUP pinMode ( zeroCrossingPin , INPUT_PULLUP ) ; #else pinMode ( zeroCrossingPin , INPUT ) ; digitalWrite ( zeroCrossingPin , HIGH ) ; #endif pinMode ( dataPin , OUTPUT ) ; }
Constructor.
Constructor .
// the output data pin // Set I/O modes: