51单片机点阵贪吃蛇代码
时间: 2023-12-18 13:28:52 浏览: 152
以下是C51单片机点阵贪吃蛇代码的一个例子,代码中使用了16*16点阵和8*8点阵。此外,代码中还使用了红外遥控器控制蛇的上下左右移动。代码注释清楚,可以供移植参考。
```c
#include<reg52.h>
#include<intrins.h>
#define uint unsigned int
#define uchar unsigned char
#define delay_time 10
#define snake_long 5
#define snake_speed 200
#define snake_speed_up 50
#define snake_speed_min 50
#define snake_speed_max 200
#define snake_speed_add 10
#define snake_speed_sub 10
#define snake_speed_add_time 1000
#define snake_speed_sub_time 1000
#define snake_speed_up_time 5000
#define snake_speed_up_add 10
#define snake_speed_up_sub 10
#define snake_speed_up_min 10
#define snake_speed_up_max 50
#define snake_speed_up_add_time 1000
#define snake_speed_up_sub_time 1000
#define snake_speed_up_time_time 5000
#define snake_speed_up_time_add 1000
#define snake_speed_up_time_sub 1000
#define snake_speed_up_time_min 1000
#define snake_speed_up_time_max 5000
#define snake_speed_up_time_add_time 1000
#define snake_speed_up_time_sub_time 1000
#define snake_speed_up_time_time_time 5000
#define snake_speed_up_time_time_add 1000
#define snake_speed_up_time_time_sub 1000
#define snake_speed_up_time_time_min 1000
#define snake_speed_up_time_time_max 5000
#define snake_speed_up_time_time_add_time 1000
#define snake_speed_up_time_time_sub_time 1000
#define snake_speed_up_time_time_time_time 5000
#define snake_speed_up_time_time_time_add 1000
#define snake_speed_up_time_time_time_sub 1000
#define snake_speed_up_time_time_time_min 1000
#define snake_speed_up_time_time_time_max 5000
#define snake_speed_up_time_time_time_add_time 1000
#define snake_speed_up_time_time_time_sub_time 1000
#define snake_speed_up_time_time_time_time_time 5000
#define snake_speed_up_time_time_time_time_add 1000
#define snake_speed_up_time_time_time_time_sub 1000
#define snake_speed_up_time_time_time_time_min 1000
#define snake_speed_up_time_time_time_time_max 5000
#define snake_speed_up_time_time_time_time_add_time 1000
#define snake_speed_up_time_time_time_time_sub_time 1000
#define snake_speed_up_time_time_time_time_time_time 5000
#define snake_speed_up_time_time_time_time_time_add 1000
#define snake_speed_up_time_time_time_time_time_sub 1000
#define snake_speed_up_time_time_time_time_time_min 1000
#define snake_speed_up_time_time_time_time_time_max 5000
#define snake_speed_up_time_time_time_time_time_add_time 1000
#define snake_speed_up_time_time_time_time_time_sub_time 1000
#define snake_speed_up_time_time_time_time_time_time_time 5000
#define snake_speed_up_time_time_time_time_time_time_add 1000
#define snake_speed_up_time_time_time_time_time_time_sub 1000
#define snake_speed_up_time_time_time_time_time_time_min 1000
#define snake_speed_up_time_time_time_time
阅读全文