(You'll have to change the numbers for how you have things hooked up. The first number says which pin stuff will come in to the Arduino on, the second is the pin the Arduino will send things out on.)
THEN, probably somewhere in "setup()", you need...
mySerialPort.begin(9600);
(Keep ONE of the " Serial.begin(9600);"s if you will also be communicating with the IDE's serial monitor.)
the software serial was not working properly so what i did was used the Arduino's TX and RX pins to connect the VRbot. When i upload code to the board i detach the VRbot and reattach it to the Arduino's RX and TX
Also its baud rate was commented out and was used only once.
When i upload code to the board i detach the VRbot and reattach it to the Arduino's RX and TX
This will certainly be necessary. But, when running, it appears that the Arduino is talking to the VRBot AND the PC over the same set of pins. I suspect that that is confusing the VRbot.
actually it works PERFECTLY..........
arduino and VRBOT works fine once the code is uploaded and VRbot reattached. Its also monitored using the serial monitor and it works just fine when I do NOT use the trigger word...... if there is an Example code where the trigger word works FINE with the Arduino would REALLLLLLLLLLLLLLLLLLLY help..!!!
I suspect that the reason no-one has responded is that you haven't acted on their earlier suggestions, where they've identified a very serious issue. Also, you really haven't given enough detail regarding what is happening, specifically, when you say that the VRBot is working perfectly, what do you mean?
Repeating what PaulS said for emphasis, the code you've posted is apparently using the arduino Serial interface to talk to the VRBot. From the sequence of VRBot commands you're sending, that is clearly your intent. However, you're also using that same interface to send commentary, presumably to a terminal program that's also attached to arduino tx. The problem is that the VRBot is receiving your debugging messages too and is trying to interpret them as commands. If you're lucky, they will make no sense to it. If you're not, you'll change something in it's configuration that will make it ignore your request to start VR. Frankly, I'm too lazy to try to figure out what the device will make of what you're sending to it, but you need to figure out another way to send progress messages back to a terminal. You were on the right track with NewSoftSerial - see if you can get that working first.
Where you are trying to read from the serial port, you can't assume that characters have arrived. Serial communication is slow; use Serial.available() to check rather than 100 attempts or delays.
Lastly, you might want to set a finite timeout in case it doesn't recognize 'Attack' in your voice/accent.
Hi,
Thank you for your input. I was busy with the hardware part of the project. Switching back to the software now and made changes to the code and finally have it working with NO trigger word.
The code is as follows:
it works perfect. I need HELP with using a trigger word.
Lets say I want the trigger word to be "MAX" and after that say either the already existing group set (e.g. in this case "word set 3" 1, 2, 33...etc.) OR specify a NEW group (e.g. Group 1 consisting of words GRAB, RELEASE, FORWARD, BACK)
Please help me with this i will REALLY appreciate it!