:873B : :1 :2022-07-13 13:28:48
void loop()
{
//状态:LOW 没有识别到黑线,HIGH识别到黑线
if(digitalRead(left_led1) == HIGH && digitalRead(right_led1) == HIGH)
{
forward();//当左右探头识别到黑线执行前进
}
else
{
if(digitalRead(left_led1) == HIGH && digitalRead(right_led1) == LOW)
{
left();//右边出线,执行左转修正
}
if(digitalRead(left_led1) == LOW && digitalRead(right_led1) == HIGH)
{
right();//左边出线,执行右转修正
}
if(digitalRead(left_led1) == LOW && digitalRead(right_led1) == LOW)
{
backward();//后退,左右寻迹探头都没识别到黑线
}
}
}
10-19arduino运行LCD
10-19Arduino超声波测距.ino
10-16arduino入门与提高
10-16arduino高级开发权威指南
10-11arduino 麦克纳姆轮控制程序
10-11arduino的点滴输液报警
10-10stm32循迹小车
10-10用arduino连接时钟模块实现时间读取