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.
Hi
I'm a beginner and as a beginner, I start with simple code....
#include "stm32f4xx.h" // Device header void delayMs(int delay); int main(void) { RCC->AHB1ENR |=1; //ENABLE GPIOA clock GPIOA->MODER |= 0x00000400; // ob 0000 0000 0000 0000 0000 0100 0000 0000 while(1) { GPIOA->ODR = 0x00000020; delayMs(500); GPIOA->ODR &=~0x20; delayMs(500); } } void delayMs(int delay) { int i=0; for(;delay>0;){ delay --; for (i=0;3195;i++); } }
Kiel does not like tilde at the line GPIOA->ODR &=~0x20;
with the warning: main.c(15): warning: implicit conversion changes signedness: 'int' to 'unsigned int' [-Wsign-conversion].
Without that line, I could switch on the LED connected, but once I add this line, the LED is always on.
Any idea?
Thanks in advance
Fausto Tromba