I want a label in my GUI to show pressed or released anytime i press or release the touch sensor. My problem now is how should i write the code on the robot side to send to the GUI. the same applies to the color sensor.
I have search the examples that comes with leJOS but the touch and color sensor examples are for the client side(GUI) and not on the robot.
I am looking for the codes on the robot side that will send the status of the touch sensor and the color sensor to the GUI.
My second problem is that how can i open the connnection to the robot continuously and exchange messages with the GUI until i close the connection at the end of the communication.
I am finding it hard how to make the connection stay. i learnt when you open a connection with the robot, it blocks and waits until something is send to it.
I used on the side of the robot,
Code: Select all
but i have to close the streams otherwise when i run the GUI, i get exceptions on the robot. Because the stream is closed i can't access the touch and color sensors.
please i need help how to get it done.
thanks for your help[/code]