output to LEDs w/out DC running.

Hey,

I have somewhat of a problem. I’m trying to turn on the LEDs on the board based on input. I have them working when the DC app is running… but if i disconnect the USB or close DC, the LEDs don’t turn on anymore. I would like to be able to turn the LEDs on and off without having it connected to the PC. Maybe I’m missing something simple. Any Ideas?

Some Code:

#define LED_DS1 6 // LED, port G bit 6
#define LED_DS2 7 // LED, port G bit 7

memset(inputMsg, 0, sizeof(inputMsg));
serFrdFlush();

while(1)
{
memset(inputMsg, 0, sizeof(inputMsg));

while(serFpeek() == -1){}

  // Read the rest of string
   while(serFread(&inputMsg,sizeof(inputMsg), 500));
  printf("msg recieved: %s

", inputMsg);

   if (strcmpi( inputMsg, "light1on" )==0)
   {
        BitWrPortI(PGDR, &PGDRShadow, 0, LED_DS1);
   }
   else if (strcmpi( inputMsg, "light1off" )==0)
   {

       BitWrPortI(PGDR, &PGDRShadow, 1, LED_DS1);
   }
   else if (strcmpi( inputMsg, "light2on" )==0)
   {
        BitWrPortI(PGDR, &PGDRShadow, 0, LED_DS2);
   }
   else if (strcmpi( inputMsg, "light2off" )==0)
   {

       BitWrPortI(PGDR, &PGDRShadow, 1, LED_DS2);
   }

Help would be greatly appreciated…

nvm ppl. I found the problem. I basicly have to disconect the programming cable off the board and it works fine. kinda weird… anyways, thats it! :slight_smile: