I am making a device that can sense abnormal lung sounds through EdgeImpule ML, currently it is working ok when the serial monitor is on. My main concern is that it doesnt work without it and doesnt proceed with the program.
Ive seen some topics about it saying that this code below is whats causing it:
void setup()
{
// put your setup code here, to run once:
Serial.begin(115200);
//unsigned int to = 1000;
//while (!Serial && --to) {
delay(1);
//}
//while (!Serial);
Serial1.begin(9600);
//while (!Serial1);
// comment out the below line to cancel the wait for USB connection (needed for native USB)
//while (!Serial);
Serial.println("Edge Impulse Inferencing Demo");
run_classifier_init();
if (microphone_inference_start(EI_CLASSIFIER_SLICE_SIZE) == false) {
ei_printf("ERR: Could not allocate audio buffer (size %d), this could be due to the window length of your model\r\n", EI_CLASSIFIER_RAW_SAMPLE_COUNT);
return;
}
for (int ix = 0; ix < MAX_SOUNDS; ix++) {
pinMode(NEW_PIN[ix], OUTPUT);
}
}
Currently I commented the thing it suggested but after uploading it there was a problem it said that the PDM failed to start.
There was a change though since when I use an External Power Source it would not display anything, this time when I comment out the wait it displayed "SOUND SENSE" but it only reached to that point and as the photo above shows it doesnt give me the classifications anymore