void mainControlTest(void) { mainControlInit(); telemetersStart(); HAL_Delay(500); wall_follow_control.follow_type = NOFOLLOW; rotate180WithCal(CCW, 400, 0); telemetersStop(); mainControlDisplayTest(); }
void followWallTest() { mainControlInit(); telemetersStart(); motorsSleepDriver(OFF); HAL_Delay(500); // control_params.wall_follow_state = TRUE; wall_follow_control.follow_type = FOLLOW_WALL;//NOFOLLOW // moveUTurn(300, 300, 0); //while(1); move(0, 0, 0, 0); moveStartCell(500, 500); moveCell(5, 500, 300); moveRotateCW90(300, 300); moveCell(3, 500, 300); moveRotateCW90(300, 300); moveCell(2, 500, 300); moveRotateCW90(300, 300); moveCell(2, 500, 300); moveRotateCCW90(300, 300); moveCell(1, 500, 300); moveRotateCW90(300, 0); // moveRotateCW90(50, 10); // moveRotateCCW90(50, 10); // moveRotateCCW90(50, 10); while(1); moveRotateCW90(600, 200); moveRotateCW90(600, 200); moveCell(1, 600, 200); moveRotateCCW90(600, 200); moveRotateCCW90(600, 200); HAL_Delay(1000); moveCell(4, 1000, 200); HAL_Delay(1000); moveRotateCW90(600, 200); moveRotateCCW90(600, 200); moveRotateCW90(600, 200); moveRotateCCW90(600, 200); moveRotateCW90(600, 200); moveRotateCCW90(600, 200); moveRotateCW90(600, 200); moveCell(1, 600, 200); telemetersStop(); mainControlDisplayTest(); mainControlDisplayTest(); }
void rotateTest() { mainControlInit(); HAL_Delay(500); wall_follow_control.follow_type = NOFOLLOW; position_control.position_type = GYRO; move(90, 90, 300, 0); // while(isEndMove() != TRUE); // move(0, 180, 100, 0); // while(isEndMove() != TRUE); // move(0, 0, 0, 0); // while(isEndMove() != TRUE); mainControlDisplayTest(); }
int main(void) { /* USER CODE BEGIN 1 */ CMDLINE_CONTEXT cmd_context; const char *zhonx_info = (char *)CONFIG_ZHONX_INFO_ADDR; /* USER CODE END 1 */ /* MCU Configuration----------------------------------------------------------*/ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init(); /* Configure the system clock */ SystemClock_Config(); /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_DMA_Init(); MX_ADC1_Init(); MX_ADC2_Init(); MX_ADC3_Init(); MX_I2C1_Init(); MX_RNG_Init(); MX_TIM1_Init(); MX_TIM2_Init(); MX_TIM3_Init(); MX_TIM4_Init(); MX_TIM5_Init(); MX_TIM6_Init(); MX_TIM7_Init(); MX_TIM8_Init(); MX_TIM11_Init(); MX_USART3_UART_Init(); /* USER CODE BEGIN 2 */ expanderInit(); HAL_Delay(100); mainControlInit(); ssd1306Init(0); timesBaseInit(); ledPowerBlink(990, 10); settingsInit(); mulimeterInit(); bluetoothInit(); toneInit(); spyPostInit(); positionControlSetPositionType(GYRO); mainControlSetFollowType(NO_FOLLOW); toneSetVolulme(100); tone(F4, 50); toneItMode(A4, 50); // Register Output callback cmd_context.out = blockingPrintf; // Initialize Command Line module cmdline_init(&cmd_context); // Check if robot name is populated in Flash memset(zhonxName, 0, sizeof(zhonxName)); // Retrieve ZHONX information from flash if any if (zhonx_info[0] == 'Z') { strcpy(zhonxName, zhonx_info); } while (zhonxName[0] == 0) { menu(zhonxNameMenu); } while (1) { menu(mainMenu); powerOffConfirmation(); } /* USER CODE END 2 */ /* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1) ; /* USER CODE END WHILE */ /* USER CODE BEGIN 3 */ /* USER CODE END 3 */ }