New Homepage › Forums › Special Shields › Voice recognition
Tagged: VoiceRecognition
This topic contains 10 replies, has 2 voices, and was last updated by alains 1 year, 11 months ago. This post has been viewed 369 times
-
AuthorPosts
-
January 6, 2019 at 10:13 PM #119194
This is my problem: I try to enter data using voice – see my code below – It works for the first data: strTemp but when entering the second data the returned voice value is the same as the first. I tried several delays but nothing worked.
redo1:
Terminal.println (“Say Enter Start Temperature:”);
if(VoiceRecognition.isNewCommandReceived())voiceCommand = VoiceRecognition.getLastCommand();
OneSheeld.delay(5000);
Terminal.println (“command: “+ String(voiceCommand));//VERIFY
if(atoi(voiceCommand)>0)strTemp = atoi(voiceCommand); else goto redo1;redo2:
Terminal.println (“Say Enter Step Temperature:”);
if(VoiceRecognition.isNewCommandReceived())voiceCommand = VoiceRecognition.getLastCommand();
OneSheeld.delay(5000);
Terminal.println (“command: “+ String(voiceCommand));//VERIFY
if(atoi(voiceCommand)>0)stepTemp = atoi(voiceCommand); else goto redo2;January 13, 2019 at 9:15 PM #120302Hi,
I have checked out your code and have edited it so that you get the received voice command on the terminal screen (find the new code below). But let me tell you to avoid when you are coding (this based on your code):
– don’t use goto label since it makes the code ununderstood.
– always use the parenthesis so that your code is readable and logic is maintained.
And here is the code, give it a try and let me know if you got it working 🙂
Code:
C++123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354/*OPTIONAL:To reduce the library compiled size and limit its memory usage, youcan specify which shields you want to include in your sketch bydefining CUSTOM_SETTINGS and the shields respective INCLUDE_ define.*/#define CUSTOM_SETTINGS#define INCLUDE_VOICE_RECOGNIZER_SHIELD#define INCLUDE_TERMINAL_SHIELD/* Include 1Sheeld library. */#include <OneSheeld.h>char commandReceived[300]; // maximum voice command characters are 300void setup(){/* Start Communication. */OneSheeld.begin();/* Error Commands handiling. */VoiceRecognition.setOnError(error);VoiceRecognition.start();}void loop (){/* Check if new command received. */if(VoiceRecognition.isNewCommandReceived()){strcpy(commandReceived , VoiceRecognition.getLastCommand());Terminal.print("Command: ");Terminal.println(commandReceived);}}/* Error checking function. */void error(byte errorData){/* Switch on error and print it on the terminal. */switch(errorData){case NETWORK_TIMEOUT_ERROR: Terminal.println("Network timeout");break;case NETWORK_ERROR: Terminal.println("Network Error");break;case AUDIO_ERROR: Terminal.println("Audio error");break;case SERVER_ERROR: Terminal.println("No Server");break;case SPEECH_TIMEOUT_ERROR: Terminal.println("Speech timeout");break;case NO_MATCH_ERROR: Terminal.println("No match");break;case RECOGNIZER_BUSY_ERROR: Terminal.println("Busy");break;}}January 14, 2019 at 10:53 PM #120464Hi Amr:
That worked,thanks!
I have another problem with the board: I can’t have it connected to the phone without typing lightly to the switch 5V/3V on your board. It seems a bad electrical connection,at first I thought that was in the switch but now I’m not sure,it can be on the bluetooth ? What should I do? Note that I returned a board to Amazon with a similar problem about one month ago…January 15, 2019 at 12:57 PM #120539Hi Alains,
Glad to know that you got it working!
And I am sorry for the issue you face with the board. May you please try to plug the Arduino to the pc USB so that you ensure it takes the steady power it needs then have the switch on 5V and look at the Ble LED of the Bluetooth and let me know if it’s blinking or not.
Then try to connect to the board from 2 different phones (from the 1Sheeld App of course) and let me know the results.
January 16, 2019 at 7:49 AM #120647OK I did the test: There is no LED on for BLE… I switched to an old Samsung 4 it still works the same: I have to tap the switc to initiate the program…
Maybe it is from the UNO as I remember testing with a Mega and the LED were on. I will try the Mega tomorrow.January 17, 2019 at 10:56 PM #120936I have the same problem with the Mega: No LED On for BT. I believe that there is a malfunction on bluetooth IC What should I do?
January 23, 2019 at 5:33 PM #121942Hi Alains,
Sorry that you are facing this BLE issue with your board and we can offer you a replacement 1Sheeld if you have purchased it within the last 6 months.
So, please send me your Amazon reset photo OR Amazon’s order screenshot to my email: “[email protected]” and I will follow up with you.
January 31, 2019 at 3:19 AM #122923Thanks Amer
All done…February 25, 2019 at 12:47 AM #126642Hi Amr:
I have sent the information that you have requested about 3 weeks ago, and I did not have received the new 1S board. Can you verify as I need to finish a project with it.
Thanks
AlainFebruary 25, 2019 at 7:34 PM #126760Hi Alains,
I have emailed you twice asking kindly for your phone number to complete the shipping but I got no response from you!
So, please check your email to verify that and send me your phone number so that I can complete the shipping order for you.
February 26, 2019 at 10:23 PM #126986No trace of your mails.
I just sent the information to your email:
[email protected]
Thanks -
AuthorPosts
You must be logged in to reply to this topic.