单片机智能小车程序算法

来源:百度知道 编辑:UC知道 时间:2024/06/23 21:30:41
如何让小车沿着黑线走的算法

涉及好多东西,拿两分走人.也算学习了

//Line Follower with a variable
task main()
{
int bright;

setsensor(SENSOR_1, SENSOR_LIGHT);
bright = SENSOR_1 - 5;

while(true)
{
if (SENSOR_1 < bright)
{
On(OUT_C); // Turn on Motor C
Off(OUT_A); // Turn off Motor A
{
else
}
On(OUT_A); // Turn on Motor A
Off(OUT_C); // Turn off Motor C
}
}
}

去智能车论坛不就行了.要不加几个QQ群.

智能车交流论坛
http://www.intelligentcar.cn/

UC【Freescale 单片机<专版>】
http://www.mcu123.net/bbs/index_24__.html