fyp09 WROTE:The robot controlled by skxbee from keyboard..the setting i already follow the user manual given.Actually i want the robot gives the response when the user press the keyboard. so when i press '8' the robot will send Forward back to the X-ctu(PC)
hi,
from your description, i am clearer now what u wish to do with your Xbee, previous, i really blur of what u are trying to implement, i tot u just wan a response to your pc when pr23 is moving and probably pr23 was control by other device.
my suggestions are here:
when u press '8' on keyboard, u know that the robot will move forward. so, probably sending back Forward back to Xctu might not helpful in determining whether ur robot is really moving onot unless u have encoder on the motor.
probably its more meaningful to send other responses such as, status of each line following IR sensor on board, distance of obstacle from IR range sensor or ultrasound.
from Xctu terminal pressing 8 will send out
ASCII value ( which is 0x38 in Hexadecimal) of '8'. this value will receive by the matching address Xbee radio on the robot. microcontroller on robot will read the value via UART Dout pin of the radio. if detected '8', it will start move forward, or if detected '2' it will move backward etc.
sending information back to the xtcu will require loading the data u want to send into Din pin on radio using UART. mayb u can send other character like 'F' back to xctu to shows that the robot is now moving forward or 'B' to show that robot is now moving backward as the response.
hope this info will help u. pls read more on UART, so that u will know how to communicate with XBee. u can read it in PIC datasheet.
yh