Announcement

Collapse
No announcement yet.

Standard bliniking program not working?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Standard bliniking program not working?

    Hello, everyone!
    I am trying to get a standard linking led program running on my STM8S103F3P6 development board but I am not sure what I am doing wrong. I connected a LED to PIN D3, this is my code:
    #include <stm8s. h>
    void
    delay_ ms (uint16. _t ms) ;
    void
    delay_ _ms(uint16 _t ms) {
    while
    (ms- -) {
    uint16_ t i;
    for
    (i = 0:i< ms; i++){
    nop () ;
    }
    }
    }
    main()
    {
    GPI0D- >DDR |=0x03;
    //PD3 as Output
    GPI0D- >CR1 |=0x03:
    //PD3 as Push Pull
    while
    GPI0D- >0DR|=(1<<3) :
    //turn PD3 on
    de1ay_ ms (1000):
    GPI0D->0DR&=' ~ (1<<3) ;
    //turn PD3 off
    delay_ ms (1000) :
    }
    }
Working...
X