We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
This is the program I'm trying to run. It's actually a program for a running light but for GPIOB's LED which is connected for the first LED just stayed on all the time, while the other 3 LED which is at GPIOA is is a running light sequence.
#include "stm32f4xx.h"void delayMs(int n);
int main(){ RCC -> AHB1ENR |= 3; GPIOA -> MODER &= ~0x0000FC00; GPIOA -> MODER |= 0x00005400; GPIOB -> MODER &= ~0x00003000; GPIOB -> MODER |= 0x00001000;
while(1){ GPIOB->BSRR |= 0x004000A0; delayMs(500); GPIOA->BSRR |= 0x00800060; delayMs(500); GPIOA->BSRR |= 0x004000A0; delayMs(500); GPIOA->BSRR |= 0x002000C0; delayMs(500); }}
void delayMs (int n){ int i; for(; n>0; n--) for(i=0; i<3000; i++);}
Can someone help me?
I'm a new member here, so I'm sorry for this one. I should have explored more on the settings, before posting.