Touch Sensor

Post your NXJ projects, project ideas, etc here!

Moderators: 99jonathan, roger, imaqine

Touch Sensor

Postby win1for » Fri Mar 26, 2010 12:14 pm

How can i write a listener for the TouchSensor.

How do i implement the stateChenged() method. When the touch sensor is pressed what value does it return.

thanks
win1for
Novice
 
Posts: 48
Joined: Tue Mar 02, 2010 11:22 pm

Postby gloomyandy » Fri Mar 26, 2010 12:21 pm

Why don't you try it and see what happens...
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4174
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Postby win1for » Fri Mar 26, 2010 12:32 pm

Thanks for your reply.

Infact am just a beginner in robot programming and have no clue how the Touchsensors are implemented. I have to show in my GUI(PC application) the status of the TouchSensor anytime it is pressed or released.

I have read the leJOS tutorials but there is no example there. I don't even know if writing the listerner will help. I just don't know what should go inside the stateChanged() method.

please if you know a tutorial then kindly point me there.

Do i have to declare a TouchSensor class in the GUI side also to test whether it is pressed or released?

I need explanation how it is done and i will do it myself. i just need explanation what must be done in the client side(GUI) and what should be done in the robot side and i will start from there to continue.

Thanks.
win1for
Novice
 
Posts: 48
Joined: Tue Mar 02, 2010 11:22 pm


Return to NXJ Projects

Who is online

Users browsing this forum: No registered users and 2 guests

more stuff