Question: Hello I need help creating this code in c language ( stm 3 2 microcontroller ) I've done some of the code but need help

Hello I need help creating this code in c language (stm32 microcontroller) I've done some of the code but need help correcting / adding on to it. I'll paste below my code and the directions of how the code is supposed to go. Thanks.
My code so far:
#include "main.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
/* Private typedef -----------------------------------------------------------*/
/* USER CODE BEGIN PTD */
/* USER CODE END PTD */
/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */
/* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/
/* USER CODE BEGIN PM */
/* USER CODE END PM */
/* Private variables ---------------------------------------------------------*/
UART_HandleTypeDef huart2;
/* USER CODE BEGIN PV */
/* USER CODE END PV */
/* Private function prototypes -----------------------------------------------*/
void SystemClock_Config(void);
static void MX_GPIO_Init(void);
static void MX_USART2_UART_Init(void);
/* USER CODE BEGIN PFP */
/* USER CODE END PFP */
/* Private user code ---------------------------------------------------------*/
/* USER CODE BEGIN 0*/
/* USER CODE END 0*/
/**
* @brief The application entry point.
* @retval int
*/
int main(void)
{
/* USER CODE BEGIN 1*/
int count==0;
int value1;
int value2;
/* USER CODE END 1*/
/* MCU Configuration--------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* USER CODE BEGIN Init */
/* USER CODE END Init */
/* Configure the system clock */
SystemClock_Config();
/* USER CODE BEGIN SysInit */
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_USART2_UART_Init();
/* USER CODE BEGIN 2*/
/* USER CODE END 2*/
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (button_0==1)
{
led_0==1;
/* USER CODE END WHILE */
/* USER CODE BEGIN 3*/
}
while (button_1==0)
value1== led_1;
led_1==!value1;
}
while(count 2)
{
if(button_1==2)
{value2== led_2;
led_2==!value2;
count ==0;
}
count = count +1;
}
Hello I need help creating this code in c

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!