Initial Forays - Very Impressive

OK, I’ve got the system setup and run the very simple demo from the tutorial (blinks a blue led).

Couple of questions:

  1. I see warnings about initialization taking too long, I’m guessing the ProgramStarted is expected to do just a little work but return pretty quickly and this is just the demo, no problem - let me know though if this is not something I should see.

  2. I stopped the app but the light continues to flash, I pressed Reset and it stopped then resumed, is this expected? how does one stop the app in this situation?

Thanks

  1. I guess, that you have infinite cycle in ProgramStarted method or something like Thread.Sleep(-1) at the end of that method, don’t use infinite sleep, let that method end. You should use ProgramStarted method only to initialize everything you want to use (your custom code) and if you want to use long or infinite cycle, it should be done in seperate thread.

void ProgramStarted()
{
    Thread blinkThread = new Thread(new ThreadStart(BlinkLed));
    blinkThread.Start();

    Debug.Print("Program Started");
}

private void BlinkLed()
{
    while(true)
    {
    Mainbord.SetDebugLED(true);
    Thread.Sleep(500);
    Mainboard.SetDebugLED(false);
    Thread.Sleep(500);
    }
}
  1. It continuous to flash, because the app is saved on the mainboard. So when you restart it or power it off and back on, your app starts. The app is deployed to mainboard when you start debugging. Check output window when you hit start debugging button in Visual Studio. I know only one way to stop it - by disconnecting power. :smiley:

[quote=“KorporalKernel”]

  1. I see warnings about initialization taking too long, I’m guessing the ProgramStarted is expected to do just a little work but return pretty quickly and this is just the demo, no problem - let me know though if this is not something I should see.[/quote]
    Here’s my explaination of the problem.
    https://www.youtube.com/watch?v=N_-WtRnf6RA

Like @ miroga said, your board knows one thing and one thing only - your program. To stop it you just either unplug the power or program in a way to stop it upon button push, etc.

[quote=“ianlee74”]

Thanks Ian, very interesting - wasn’t aware that the app was in charge to the degree, thanx\