Programming isn't very sexy-time (in our opinion). Let's just get all of the programming out of the way.

<pre>/* Romance Pants by Team Instructables Principle Actors include: Audrey Love, Amanda Ghassaei, Randy Sarafan This code is sending wireless serial data from a zipper potentiometer and waist button via an Xbee shield For more information, please visit: https://www.instructables.com/id/Romance-Pants/ this code is public domain, please enjoy! */ //waist button attached to digital pin 2 #define button 2 //zipper potentiometer connected to analog pin 0 #define zipper A0 //storaga variables int buttonState = 0; // variable for reading the waist button status int zipperState = 0; // variable for reading the zipper status void setup() { // initialize serial communication: Serial.begin(9600); // initialize pins pinMode(button, INPUT); pinMode(zipper, INPUT); } void loop(){ // check the state of the zipper/button buttonState = digitalRead(button); zipperState = analogRead(zipper); // check if the waist button is open. // if it is, the buttonState is LOW: if (buttonState == LOW) { Serial.print('z'); } //scale zipper state zipperState = zipperState/4; //send zipper state Serial.write(zipperState); delay(50); }

<pre>/* Romance Pants by Team Instructables Principle Actors include: Audrey Love, Amanda Ghassaei, Randy Sarafan This code is receiving wireless serial data from a pair of pants via Xbee and: - controlling a fan controller to dim room lighting in correlation to a pants zipper - raising volume on a stereo when the zipper is lowered - lighting candles when the pants are unbuttoned For more information, please visit: https://www.instructables.com/id/Romance-Pants/ Based on code from http://www.ladyada.net/learn/sensors/ir.html this code is public domain, please enjoy! */ // Defines the LED connected to digital pin 13 int IRledPin = 13; // Lamps connected to digital pin 9 int lampsPin = 3; int sentDat; int prevSentDat; //establish the compare value //for the volume up command int dropping = 250; void setup() { // initialize the IR digital pin as an output: pinMode(IRledPin, OUTPUT); //initializes the candle output pin pinMode(8, OUTPUT); pinMode(9, OUTPUT); Serial.begin(9600); } void loop() { if (Serial.available() > 0) { prevSentDat = sentDat; sentDat = Serial.read(); if (sentDat > prevSentDat){//if the new value is higher than last while (prevSentDat < sentDat){ prevSentDat++;//increment prevSent analogWrite(lampsPin, prevSentDat); delay(5); } } else{//new value is lower while (prevSentDat < sentDat){ prevSentDat--;//decrement prevSent analogWrite(lampsPin, prevSentDat); delay(5); } } //if the resistance is dropping, turn up the volume if(dropping <= sentDat){ //volume goes up volumeUp(); // wait for 30 milliseconds delay(30); dropping = sentDat - 5; } if(sentDat == 'z') { // fade out from max to min in increments of 5 points: digitalWrite(8, HIGH); digitalWrite(9, HIGH); delay(10000); digitalWrite(8, LOW); digitalWrite(9, LOW); } } } // This procedure sends a 38KHz pulse to the IRledPin // for a certain # of microseconds. We'll use this whenever we need to send codes void pulseIR(long microsecs) { // we'll count down from the number of microseconds we are told to wait cli(); // this turns off any background interrupts while (microsecs > 0) { // 38 kHz is about 13 microseconds high and 13 microseconds low digitalWrite(IRledPin, HIGH); // this takes about 3 microseconds to happen delayMicroseconds(10); // hang out for 10 microseconds digitalWrite(IRledPin, LOW); // this also takes about 3 microseconds delayMicroseconds(10); // hang out for 10 microseconds // so 26 microseconds altogether microsecs -= 26; } sei(); // this turns them back on } void volumeUp() { // This is the code for my particular JVC stereo // for the volume-up button delayMicroseconds(1520); pulseIR(520); delayMicroseconds(1540); pulseIR(520); delayMicroseconds(500); pulseIR(520); delayMicroseconds(520); pulseIR(520); delayMicroseconds(500); pulseIR(520); delayMicroseconds(1520); pulseIR(520); delayMicroseconds(500); pulseIR(520); delayMicroseconds(1540); pulseIR(520); delayMicroseconds(500); pulseIR(520); delayMicroseconds(1540); pulseIR(520); delayMicroseconds(1520); pulseIR(520); delayMicroseconds(1520); pulseIR(520); delayMicroseconds(1540); pulseIR(520); delayMicroseconds(500); pulseIR(520); delayMicroseconds(480); pulseIR(520); delayMicroseconds(500); pulseIR(520); delayMicroseconds(20140); pulseIR(520); /////// delayMicroseconds(1520); pulseIR(520); delayMicroseconds(1540); pulseIR(520); delayMicroseconds(500); pulseIR(520); delayMicroseconds(520); pulseIR(520); delayMicroseconds(500); pulseIR(520); delayMicroseconds(1520); pulseIR(520); delayMicroseconds(500); pulseIR(520); delayMicroseconds(1540); pulseIR(520); delayMicroseconds(500); pulseIR(520); delayMicroseconds(1540); pulseIR(520); delayMicroseconds(1520); pulseIR(520); delayMicroseconds(1520); pulseIR(520); delayMicroseconds(1540); pulseIR(520); delayMicroseconds(500); pulseIR(520); delayMicroseconds(480); pulseIR(520); delayMicroseconds(500); pulseIR(520); delayMicroseconds(20140); pulseIR(520); /////// delayMicroseconds(1520); pulseIR(520); delayMicroseconds(1540); pulseIR(520); delayMicroseconds(500); pulseIR(520); delayMicroseconds(520); pulseIR(520); delayMicroseconds(500); pulseIR(520); delayMicroseconds(1520); pulseIR(520); delayMicroseconds(500); pulseIR(520); delayMicroseconds(1540); pulseIR(520); delayMicroseconds(500); pulseIR(520); delayMicroseconds(1540); pulseIR(520); delayMicroseconds(1520); pulseIR(520); delayMicroseconds(1520); pulseIR(520); delayMicroseconds(1540); pulseIR(520); delayMicroseconds(500); pulseIR(520); delayMicroseconds(480); pulseIR(520); delayMicroseconds(500); pulseIR(520); delayMicroseconds(20140); pulseIR(520); /////// delayMicroseconds(1520); pulseIR(520); delayMicroseconds(1540); pulseIR(520); delayMicroseconds(500); pulseIR(520); delayMicroseconds(520); pulseIR(520); delayMicroseconds(500); pulseIR(520); delayMicroseconds(1520); pulseIR(520); delayMicroseconds(500); pulseIR(520); delayMicroseconds(1540); pulseIR(520); delayMicroseconds(500); pulseIR(520); delayMicroseconds(1540); pulseIR(520); delayMicroseconds(1520); pulseIR(520); delayMicroseconds(1520); pulseIR(520); delayMicroseconds(1540); pulseIR(520); delayMicroseconds(500); pulseIR(520); delayMicroseconds(480); pulseIR(520); delayMicroseconds(500); pulseIR(520); delayMicroseconds(20140); pulseIR(520); /////// }

The Bullduino should be loaded with the following transmitter code:The Arduino for the receiver box should be loaded with the following code:

When both are programmed, make sure they are powered down and attach the wireless shields. Make certain that the microswitches on both of the the shields are toggled to "micro."