/*H0AR9x-main code
 BitzOS (BOS) V0.2.9 - Copyright (C) 2017-2023 Hexabitz
 All rights reserved

 File Name     : main.c
 Description   : Main program body.
 */
/* Includes ------------------------------------------------------------------*/
#include "BOS.h"
uint16_t prox;
int q;


/* Private function prototypes -----------------------------------------------*/
// char *user_data = "The application is running\r\n"; //demo data for transmission-
/* Main function ------------------------------------------------------------*/

int main(void){

	Module_Init();		//Initialize Module &  BitzOS

	//MX_USART5_UART_Init();
		//Don't place your code here.
	for(;;){}
}

/*---float H0AR9_temperature;
float H0AR9_humidity;--------------------------------------------------------*/

/* User Task */
void UserTask(void *argument){

	while(1){
	SampleDistance(&prox);
		q  =prox;
		if (q > 15)
		HAL_GPIO_WritePin(GPIOB, GPIO_PIN_8, GPIO_PIN_SET);
		Delay_ms(1.5);
		HAL_GPIO_WritePin(GPIOB, GPIO_PIN_8, GPIO_PIN_RESET);
		Delay_ms(20);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_8, GPIO_PIN_SET);
    Delay_ms(0.5);
		HAL_GPIO_WritePin(GPIOB, GPIO_PIN_8, GPIO_PIN_RESET);
		Delay_ms(10);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_8, GPIO_PIN_SET);
    Delay_ms(2.5);
		HAL_GPIO_WritePin(GPIOB, GPIO_PIN_8, GPIO_PIN_RESET);
		Delay_ms(50);

	}
}



/*-----------------------------------------------------------*/