Skip to content

Instantly share code, notes, and snippets.

@arjo129
Created April 30, 2014 03:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arjo129/9c73ec533b2b1a6f91b4 to your computer and use it in GitHub Desktop.
Save arjo129/9c73ec533b2b1a6f91b4 to your computer and use it in GitHub Desktop.
debug uspeech file from 4.1.1
#include <uspeech.h>
signal voice(A0);
char option = 0;
void setup(){
voice.calibrate();
voice.f_enabled = true;
Serial.begin(9600);
}
void loop(){
//voice.sample();
char c=voice.getPhoneme();
if(option==0){
Serial.println("uSpeech debug tool--------");
Serial.println(" Press 'a' if you wish to calibrate/check the f algorithm");
Serial.println(" Press 'b' if you wish to calibrate/check the getPhoneme");
Serial.println(" Press 'c' if you wish to calibrate/check the volume of your microphone");
Serial.println(" Press 'd' if you wish to calibrate/check the coeff");
option = 1;
}
if(option==1){
if (Serial.available() > 0) {
// read the incoming byte:
option = Serial.read();
}
}
if(option=='a'){
Serial.println(voice.micPower);
}
if(option=='b'){
Serial.println(c);
}
if(option=='c'){
Serial.println(voice.power());
}
if(option=='d'){
Serial.println(voice.testCoeff);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment