Hello, I tried searching in here and couldnt find what I was looking for. Story short, my pc send to the arduino a command (keyword) through xbee and the arduino, based on the keyword will do something and send a response back. I need to send strings through xbee because I attach the module ID to the response so the pc knows which module replied back.
The problem I have is that the first command works fine. When I send a second command, the serial string sent still includes the first response.
Here is the serial monitor results:
CM <---- command from PC
AA16| <--- response sent o pc from arduino (Good!)
TEST <---- command from PC
AA16|CMCOK| <--- response sent o pc from arduino (BAD!).. should only be "CMCOK|"
I am using xbee.print so I am able to send the string. Before I added the Module ID to it, I was using xbee.write because it was not using a string variable and everything was working fine.
well i need to send the module id and the response. my app on pc reads the data and separate the id from the answer so it knows which module the response is attached to.
i will have multiple modules so the way i understand it, with xbee, all the modules will receive the command. unless there is a way to target a specific xbee? Havent really searched for that. If there is a way, is there a possibility for arduino to get me that identification?