Hi guys! my university project is an electronic stethoscope, using a FEZ cerbuino bee and a mic inserted into the end of a normal stethoscope. The objective is to obtain a value for BPM in visual studio. When running the program shown below, I seem to randomly get this error message;
“An unhandled exception of type ‘System.Exception’ occurred in Microsoft.SPOT.Hardware.dll”
Could someone give my guidance as to why this happens?
using System;
using Microsoft.SPOT;
using System.Threading;
using Microsoft.SPOT.Hardware;
using GHI.Premium.Hardware;
using GHI.OSHW.Hardware;
namespace MFConsoleApplication1
{
public class Program
{
public static void Main()
{
AnalogInput lightSensor = new AnalogInput(FEZCerbuino.Pin.AnalogIn.A1);
double lightSensorReading = 0;
while (true)
{
lightSensorReading = lightSensor.Read();
Debug.Print(lightSensorReading.ToString());
Thread.Sleep(25);
}
}
void programStarted()
{
Debug.Print("Program Started");
}
}
}