This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Setting port as output, turn on led

Hello everyone. I have an evaluation kit EKK-LM3S9B96. I try to write simply program, just turn on led. I think i do it good and i don't know where i do mistake.

#include <LM3Sxxxx.H>
int main()
{
        GPIODirModeSet(GPIO_PORTD_BASE,GPIO_PIN_7,GPIO_DIR_MODE_OUT);
        GPIOPinWrite(GPIO_PORTD_BASE,GPIO_PIN_7,0xff);
}


I set pin 7 as out and next put there 1. I would be greatfull for some help.

Parents
  • Not familiar with the processor, but you've missed one thing that sure won't help:

    #include <LM3Sxxxx.H>
    int main()
    {
            GPIODirModeSet(GPIO_PORTD_BASE,GPIO_PIN_7,GPIO_DIR_MODE_OUT);
            GPIOPinWrite(GPIO_PORTD_BASE,GPIO_PIN_7,0xff);
    
            for (;;)  // <<< Make sure you don't fall off the end of 'main' 
              ;
    }
    

Reply
  • Not familiar with the processor, but you've missed one thing that sure won't help:

    #include <LM3Sxxxx.H>
    int main()
    {
            GPIODirModeSet(GPIO_PORTD_BASE,GPIO_PIN_7,GPIO_DIR_MODE_OUT);
            GPIOPinWrite(GPIO_PORTD_BASE,GPIO_PIN_7,0xff);
    
            for (;;)  // <<< Make sure you don't fall off the end of 'main' 
              ;
    }
    

Children