资源简介
搜集了近十个团队比赛用的飞思卡尔小车程序源代码,适合二次开发

代码片段和文件信息
?????????????
/*
***********************************************************************************
* ????:SmartCar
* ????:??????16????MC9S12DG128B???????????????
* IDE??: Metrowerks CodeWarrior 4.1
* ????:
* main.c
* SmartCar.c/PID.c/LCD1620.c/Test.c
* ??: ???????????????????????
* ??:ffice:smarttags“ />2006-5-6
* (c) Copyright 2006Zhao Cheng
* All Rights Reserved
*
*
* By : Zhao Cheng
**********************************************************************************/
/*
************************************************************************************ main.c
*
* (c) Copyright 2006Zhao Cheng
* All Rights Reserved
*
* By : Zhao Cheng
**********************************************************************************/
#include /* common defines and macros */
#include /* derivative information */
#pragma link_INFO DERIVATIVE “mc9s12dg128b“
#define HIGHSPEED 11500 /* ????????????? */
#define LOWSPEED0 12500 /* 0-24000 ???????? */
#define LOWSPEED1 12000 /* used in CarMain() */
#define STABMAX 50
#define StopCar() PORTK |= 0x80 /* stop the motor */
#define StartCar() PORTK |= 0x04 /* start the motor */
#define BrakeCar() PORTK &= 0xfb /* slow the speed of the SmartCar */
unsigned int SYSCLOCK=0; /* update in INT_Timer0() */
/*
***********************************************************************************
* FUNCTION PROTOTYPES
**********************************************************************************/
/* write in “SmartCar.c“ */
void Init_INT_RTI(void); /* initiate Real Time Interrupt */
void Init_INT_Timer(void); /* INT_Timer0 initiate */
void Init_PWMout(void); /* initiate PWM output */
void PWMout(int int); /* output PWM */
/* write in “PID.c“ */
void Init_PID(void); /* initiate PID parameter */
int CalculateP(void); /* calculate parameter P */
float CalculatePID(void); /* calculate PID */
int SignalProcess(unsigned char); /* Process the signal from the sensors */
/* write in “Test.c“ */
void IOtest(void); /* Test I/O */
void PWMtest(void); /* Test PWM output */
int SignalTest(void); /* Test the sensors */
/* write in local file */
void Init(void); /* initiate parameter */
void ProtectMoto(void); /* the function protecting the Motor */
void CarMain(void); /* SmartCar main function */
/*
***********************************************************************************
* ???
*
* ????: ????????????????????????I/O??PWM ????
* ???????????????
*
* ????:PORTB ????
* PWM ??? (1)??? (2)???????MC33886
*
* ??: ?
**********************************************************************************/
void main(void)
{
Init();
DDRB = 0x00;
switch(PORTB)
{
case 0x80:
IOtest();
break;
case 0x40:
PWMtest();
break;
case 0x20:
SignalTest();
break;
default:
DDRA = 0x00;
DDRB = 0xff;
DDRK = 0xff;
PORTB = 0xff;
CarMain();
EnableInterrupts;
f
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 5420 2010-05-09 11:28 freescale\华中科大\main.c
文件 3367 2010-05-09 11:28 freescale\华中科大\PID.c
文件 3140 2010-05-09 11:28 freescale\华中科大\SignalProcess.c
文件 2106 2010-05-09 11:28 freescale\华中科大\SmartCar.c
文件 15887 2010-04-23 19:32 freescale\华中科技.c
文件 12830 2010-04-23 19:51 freescale\南京邮电.c
文件 12830 2010-04-23 19:52 freescale\第三届 南京邮电.c
文件 16350 2010-04-24 21:26 freescale\第三届 武汉科技大学.c
文件 20434 2010-04-23 19:44 freescale\第三届 湖北光电.c
文件 5551 2010-05-02 13:52 freescale\第二届 极品飞车.c
文件 19726 2010-05-02 00:37 freescale\第二届 重邮1.c
文件 12085 2010-05-02 00:40 freescale\第二届 重邮2.c
文件 21202 2010-04-23 19:39 freescale\第四届 西北师范.c
目录 0 2013-09-08 12:47 freescale\华中科大
目录 0 2013-09-08 12:47 freescale
----------- --------- ---------- ----- ----
150928 15
- 上一篇:51单片机控制GSM模块实现短信控制继电器
- 下一篇:ATmega128开发板
相关资源
- 51 单片机 红外避障小车 大集合136
- 基于MSP430G2553的蓝牙控制小车
- 飞思卡尔单片机MC9S12XS12G128驱动(硬件
- 红外循迹小车VHDL程序
- 全国电子设计大赛自动寻迹小车论文
- 最简单的平衡小车
- 飞思卡尔68HC08Metrowerks_CodeWarrior开发软
- 智能小车循迹加避障电路图
- STM32循迹小车
- 飞思卡尔单片机.s19文件方法详解
- 基于PLC的自动运料小车的控制
- 小车自动往返控制电路图
- 基于PIC单片机的智能循迹小车设计
- s形无碳小车三维装配图
- 遗传算法越野小车unity5.5
- 毕业设计智能小车
- 基于K60的线性CCD摄像头的自主循迹平
- 灭火小车程序
- 五路循迹智能小车
- labview程序无线控制的小车
- 平衡小车之家全套资料
- 循迹小车51程序(超声波 颜色识别 舵
- 运料小车PLC编程
- 自动入库小车设计
- 滤波-卡尔曼滤波-互补滤波
- 平衡小车之家资料.zip
- 平衡小车之家原版资料
- 基于STM32F103C8T6的循迹避障小车完成
- 51单片机智能小车花式,寻迹,红外,
- 五路寻迹模块+寻迹传感器+循迹模块
评论
共有 条评论