#include "stm32f746xx.h" #include #include "uart.h" #define GPIOBEN (1U<<1) #define PIN0 (1U<<0) char Key; int main(void) { uart4_RXtx_init(); RCC->AHB1ENR |= GPIOBEN; // set the mode of the gpio pin for gpiob(pb0) and gpioc(pc13) GPIOB->MODER |=(1U<<0); GPIOB->MODER &=~(1U<<1); while(1) { // uart4_write(" Him"); // GPIOB->ODR ^= PIN0; Key = uart2_read(); if(Key == '1') { GPIOB->ODR |= PIN0; } else { GPIOB->ODR &=~ PIN0; // GPIOB->ODR |= PIN0; } } }