//LED + BEEP + Key   Experimental test

#include "key.h"
#include "led.h"
#include "delay.h"
#include "tracking.h"
#include "motor.h"
#include "sys.h"

int main(void)
{
u8 key=0;
delay_init(); // Delay function initialization
LED_Init(); // Initialization and LED Connected hardware interface
KEY_Init();
XUNJI_Init();
MOTOR_Init();

while(1)
{
if(XUNJI_IN1==0&XUNJI_IN2==1&XUNJI_IN3 ==1&XUNJI_IN4==0)
{
go();
}
else 
if( (XUNJI_IN1==1&XUNJI_IN2==1&XUNJI_IN3 ==1&XUNJI_IN4==0)|
(XUNJI_IN1==1&XUNJI_IN2==1&XUNJI_IN3 ==0&XUNJI_IN4==0)|
(XUNJI_IN1==1&XUNJI_IN2==0&XUNJI_IN3 ==0&XUNJI_IN4==0)|
(XUNJI_IN1==0&XUNJI_IN2==1&XUNJI_IN3 ==0&XUNJI_IN4==0) )
{
turn_left();
}
else 
if( (XUNJI_IN1==0&XUNJI_IN2==0&XUNJI_IN3 ==0&XUNJI_IN4==1)|
(XUNJI_IN1==0&XUNJI_IN2==0&XUNJI_IN3 ==1&XUNJI_IN4==1)|
(XUNJI_IN1==0&XUNJI_IN2==1&XUNJI_IN3 ==1&XUNJI_IN4==1)|
(XUNJI_IN1==0&XUNJI_IN2==0&XUNJI_IN3 ==1&XUNJI_IN4==0) )
{
turn_right();
}
else
{
go();
}
}
}

Technology
©2019-2020 Toolsou All rights reserved,
One is called “ Asking for the train ” A small village Finally got the train Spring Boot Lesson 16 :SpringBoot Implementation of multithreading with injection class Chrome OS, For programmers and Windows What does it mean ? Internet Marketing JAVA Convert a string to a numeric type I've been drinking soft water for three years ? What is the use of soft water and water softener You don't know ——HarmonyOS Talking about uni-app Page value transfer problem JavaScript Medium Call and ApplySparkSQL Achieve partition overlay write Character recognition technology of vehicle license plate based on Neural Network