Alasdair Ryan Posted November 2, 2010 Posted November 2, 2010 (edited) i got my self a rcx brick 1.0 yellow one and i wondered is there a way to change the action of the output of a touch sensor,at the momant i got a siren to the sensor then to the rcx when i run it the siren works pressing the sensor stops it.is there a way of the siren starts by pressing the sensor Edited November 2, 2010 by Alasdair Ryan Quote
Dryw Filtiarn Posted November 2, 2010 Posted November 2, 2010 Well obviously it would be possible to create a little program for the Mindstorms RCX that will make it possible to create a toggle function for a touch sensor. Unfortunately I don't have the software for the RCX at hand so I can't create an example for that, but you would be able to do it with the following psuedo-code: start loop set output on wait for sensor pressed set output off wait for sensor pressed end loop With above you would have a situation where the siren starts off making sound, then when you press the touch sensor it switches of and when you press the touch sensor again it would turn back on and the cycle is restarted again, where you can press it again to turn it off again. If you would use NQC (using Brixcc) to program it you could use the following code: task main() { int sirenOn = 1; SetSensor(SENSOR_1, SENSOR_TOUCH); OnFwd(OUT_A); while(true) { if (SENSOR_1 == 1 && sirenOn == 1) { sirenOn = 0; Off(OUT_A); } else { sirenOn = 1; OnFwd(OUT_A); } } } I hope that I understood your question correctly. Quote
Alasdair Ryan Posted November 2, 2010 Author Posted November 2, 2010 where do i get the softwear and what eles do i need, i need it to start switched off then press sensor whitch then turns it on i only only got the main part from bricklink Quote
DLuders Posted November 2, 2010 Posted November 2, 2010 (edited) You can download the Lego RCX 1.0 software from the Lego RCX Command Center. Note that The Lego Group (TLG) does not support the Lego RCX anymore, but there are websites that still deal with that platform. After you download the software, you can look at the "Beginning to Use the Lego Touch Sensor" example on the website http://www.kipr.org/curriculum/touch.html#anchor701290 . They have some example programming code that you could adapt to your situation. Alternatively, you could buy one of the old Lego Mindstorms CD disk ( http://www.bricklink.com/catalogPG.asp?G=4493852 ) and not worry about downloading the software. The CD contains some basic instructions that may be helpful in setting up the programmable brick. P.S. If you don't have the 9713 RCX Infrared Transmission "Tower" that accompanies the RCX kit, you won't get very far. It is needed to transfer the computer programming to the RCX brick, via an infrared signal. A picture of it appears below. Edited November 2, 2010 by DLuders Quote
Alasdair Ryan Posted November 3, 2010 Author Posted November 3, 2010 are these the same thay look like thare are but i cant be certain http://www.bricklink.com/search.asp?colorID=10&itemID=3601 Quote
Tobbe Arnesson Posted November 3, 2010 Posted November 3, 2010 Yes. If you don't have an serial interface on your computer (RS232) I recommend bying this one instead: http://www.bricklink.com/search.asp?itemID=10759 It's attached via an USB-cable instead of the serial port, serial ports are nowadays quite rare on new computers (there are still a few around, like the HP ProBook 6550b). Quote
Alasdair Ryan Posted November 3, 2010 Author Posted November 3, 2010 Yes. If you don't have an serial interface on your computer (RS232) I recommend bying this one instead: http://www.bricklink.com/search.asp?itemID=10759 It's attached via an USB-cable instead of the serial port, serial ports are nowadays quite rare on new computers (there are still a few around, like the HP ProBook 6550b). Thank you all for your help Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.