Create a gist now

Instantly share code, notes, and snippets.

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