Gast
#2434987
Hallo Liebe Leute, Ich versuche mich grade im verständniss des STM32f103VET6 aber das klappt nicht so ganz ^^ ich habe 2 Taster auf meinem Board + 1 LED und will diese LED ein und aus schalten. Aber mein Code läuft nicht wirklich... kann mir jemand vielleicht mal nen arschtrit geben das ich meinen fehler sehe und daraus lerne? wäre genial ^^ #include "stm32f10x.h" GPIO_InitTypeDef GPIO_InitStructure; int main(void) { SystemInit(); RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC, ENABLE); GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_Init(GPIOC, &GPIO_InitStructure); RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOE, ENABLE); GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2,GPIO_Pin_3; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_Init(GPIOE, &GPIO_InitStructure); if (GPIO_ReadInputDataBit(GPIOE,GPIO_Pin_2) = 0) { GPIOC->BSRR = GPIO_Pin_7; // Led Ein } if (GPIO_ReadInputDataBit(GPIOE,GPIO_Pin_3) = 0) { GPIOD->BRR = GPIO_Pin_7; // Led aus } return .0; }