The Contraption uses two LEGO Mindstorms NXT's to control it. I could have just use the one, by using a couple of extra long Home-brew NXT Cables. The two NXT's control the six modules involved with making this Crazy Contraption turn on your 'Table Lamp'.
To operate my NXTLOG 'Crazy Contraption' Entry, you first need to know how to subtract! No basic maths. No light to read by!
When the first NXT's program is run, the measuring target is positioned a random distance from the Ultrasonic Sensor at the extreme left of the gantry. The user's goal is to get the Trolley with the 'Red Plate' to move along the gantry until it is 100mm from the Ultrasonic Sensor. If you go closer than 100mm, you are forced to start again.
The RCX-TouchMux is a fully compatible, I2C Bus Type Sensor, based on a Philips PCF8574 remote I/O expander. It’s a single integrated circuit that includes eight pins that can be either inputs or outputs. The PCF8574 has eight I/O pins that are labelled P0 to P7. Full Details in a previous Article: NXT - 8 Input RCX Touch Sensor Mux. For more Information Gogle: "rjmcnamara"
When you managed to have the Trolley 100mm from the Ultrasonic Sensor, you win and a 'Ball' is dispensed. The ball drops onto a 'Trigger Mechanism' which fires 2x 'Darts' at the Black and red target which then triggers a Touch Sensor attached to the second NXT.
Once the Touch Sensor has been depressed, the second NXT sends a signal to the Mains Voltage Appliance Controller which in turn turns the 'Reading Lamp' ON!
This Lego Mindstorms NXT Appliance Controller allows you to turn on-and-off your Household mains powered equipment such as lights, radios, heaters, etc. All via your Robot. Using this Controller in conjunction with a Lego Touch Sensor allow the 'Crazy Contraption' to control the Reading Lamp, Turning the Lamp ON and OFF! For more Information Gogle: "rjmcnamara"
After spending several hours trying to upload a 4 Mega Byte video in all NXTLog formats listed. I even tried different browsers only to fail. So you will need to google "rjmcnamara." to view it.
If someone knows the secret to uploading video to NXTLog, please let me know?
The Complete 'Rube Goldberg' type Light Switch's code is written in NXC. For more Information Gogle: "rjmcnamara".