1013-基于51单片机的8路抢答器(8路,12864)原理图、流程图、物料清单、仿真图、源代码
功能介绍:
在抢答器的设计中,采用模块化的设计思想。系统以单片机作为核心部件进行逻辑控制及信号的产生,由单片机、显示模块、报警模块、语音播报模块和按键模块等组成。由14个按键和单片机等构成八路抢答器,14个按键中有8个选手按键,其余6个为主持人控制按键。在主持人按下开始键后,选手按下按键进行抢答,率先抢答成功者可以回答问题。此抢答器在保留了基本功能的同时又增加违规
加减分、语音
播报.LCD显示的实用功能。此设计完成后可实现以下功能;
(1)可以同时实现八个选手进行抢答;
(2)抢答时间和答题时间可以调整;(3)抢答器具有锁存与显示功能;
(4)当开始抢答时,主持人可以暂停比赛,进入等待状态;
(5)主持人按下开始键,抢答倒计时开始,此时进行倒计时,直到第一个选手抢答时,显示屏上显示该选手的编号和答题时间;
(6)具有规定抢答时间与答题时间,若规定时间到无人抢答或没有回答问题,蜂鸣器会报警;
(7)持人没按下开始建,选手提前按下抢答键,蜂鸣器会报警,显示相应的犯规选手编号;
(8)在比赛中,选手回答成功加分,选手回答错误减分。在比赛结束后,可以查看分数;
(9)按下电源键,会语音播报“欢迎使用抢答器",主持人按下开始,会语音播报“抢答开始",选手抢答成功,会语音播报答“几号选手抢答成功”。如果选手在比赛中违规,会语音播报“几号选手违规”,回答正确,会语音播报.回答错误也会语音播报;
( 10)LCD显示比赛名称和年月;
( 11)设置的参数具有掉电保存功能;(12)按下复位键,下一轮比赛开始;
语音功能使用蜂鸣器代替,因为仿真里面没有语音功能
有哪些资料:
1、仿真工程文件
2、源代码工程文件
3、原理图工程文件
4、流程图
5、功能介绍
6、元件清单
#include <reg51.h>
#include <intrins.h>
#include <AMPIRE128X64.h>
#include"ds1302.h"
#include"i2c.h"
sbit beep=P0^2;//蜂鸣器
sbit k1=P1^0; //选手按键
sbit k2=P1^1;
sbit k3=P1^2;
sbit k4=P1^3;
sbit k5=P1^4;
sbit k6=P1^5;
sbit k7=P1^6;
sbit k8=P1^7;
sbit s1=P3^2;//主持人按键
sbit s2=P3^3;
sbit s3=P3^4;
sbit s4=P3^5;
sbit s5=P3^6;
sbit s6=P3^7;
uchar code str1[] ={0x04,0x24,0x44,0x84,0x64,0x9C,0x40,0x30,0x0F,0xC8,0x08,0x08,0x28,0x18,0x00,0x00,
0x10,0x08,0x06,0x01,0x82,0x4C,0x20,0x18,0x06,0x01,0x06,0x18,0x20,0x40,0x80,0x00};/*"欢",0*/
uchar code str2[] ={0x40,0x40,0x42,0xCC,0x00,0x00,0xFC,0x04,0x02,0x00,0xFC,0x04,0x04,0xFC,0x00,0x00,
0x00,0x40,0x20,0x1F,0x20,0x40,0x4F,0x44,0x42,0x40,0x7F,0x42,0x44,0x43,0x40,0x00};/*"迎",1*/
uchar code str3[] ={0x80,0x60,0xF8,0x07,0x04,0xE4,0x24,0x24,0x24,0xFF,0x24,0x24,0x24,0xE4,0x04,0x00,
0x00,0x00,0xFF,0x00,0x80,0x81,0x45,0x29,0x11,0x2F,0x41,0x41,0x81,0x81,0x80,0x00};/*"使",2*/
uchar code str4[] ={0x00,0x00,0xFE,0x22,0x22,0x22,0x22,0xFE,0x22,0x22,0x22,0x22,0xFE,0x00,0x00,0x00,
0x80,0x60,0x1F,0x02,0x02,0x02,0x02,0x7F,0x02,0x02,0x42,0x82,0x7F,0x00,0x00,0x00};/*"用",3*/
uchar code str5[] ={0x10,0x10,0x10,0xFF,0x10,0x50,0x20,0x90,0x8C,0x83,0x8C,0x90,0x20,0x40,0x40,0x00,
0x04,0x44,0x82,0x7F,0x01,0x00,0x00,0x3F,0x40,0x44,0x48,0x47,0x40,0x70,0x00,0x00};/*"抢",4*/
uchar code str6[] ={0x20,0x10,0x8C,0x87,0x4C,0x54,0x24,0x14,0x28,0x47,0x44,0x8C,0x94,0x04,0x04,0x00,
0x01,0x01,0x00,0xFC,0x45,0x45,0x45,0x45,0x45,0x45,0x45,0xFC,0x00,0x01,0x01,0x00};/*"答",5*/
uchar code str7[] ={0x80,0x80,0x9E,0x92,0x92,0x92,0x9E,0xE0,0x80,0x9E,0xB2,0xD2,0x92,0x9E,0x80,0x00,
0x08,0x08,0xF4,0x94,0x92,0x92,0xF1,0x00,0x01,0xF2,0x92,0x94,0x94,0xF8,0x08,0x00};/*"器",6*/
uchar code str8[] ={0x40,0x48,0x48,0x48,0xFF,0x48,0x48,0x42,0xA2,0x9E,0x82,0xA2,0xC2,0xBE,0x00,0x00,
0x80,0x60,0x1F,0x20,0x7F,0x44,0x44,0x40,0x4F,0x48,0x48,0x48,0x48,0x4F,0x40,0x00};/*"超",0*/
uchar code str9[] ={0x00,0xFC,0x84,0x84,0x84,0xFC,0x00,0x10,0x10,0x10,0x10,0x10,0xFF,0x10,0x10,0x00,
0x00,0x3F,0x10,0x10,0x10,0x3F,0x00,0x00,0x01,0x06,0x40,0x80,0x7F,0x00,0x00,0x00};/*"时",1*/
uchar code str10[] ={0x00,0x00,0xFE,0x40,0x40,0x40,0x40,0x00,0xFF,0x80,0x40,0x20,0x10,0x08,0x00,0x00,
0x00,0x00,0x7F,0x20,0x20,0x10,0x10,0x00,0x3F,0x40,0x40,0x40,0x40,0x40,0x78,0x00};/*"比",0*/
uchar code str11[] ={0x88,0x86,0xA2,0xAA,0xAA,0xFE,0xAA,0xAB,0xAA,0xFE,0xAA,0xAA,0xA2,0x8A,0x86,0x00,
0x08,0x08,0x04,0x82,0xBF,0x42,0x22,0x1E,0x22,0x42,0xBF,0x02,0x04,0x08,0x08,0x00};/*"赛",1*/
uchar code str12[] ={0x00,0x20,0x18,0xC7,0x44,0x44,0x44,0x44,0xFC,0x44,0x44,0x44,0x44,0x04,0x00,0x00,
0x04,0x04,0x04,0x07,0x04,0x04,0x04,0x04,0xFF,0x04,0x04,0x04,0x04,0x04,0x04,0x00};/*"年",0*/
uchar code str13[] ={0x00,0x00,0x00,0xFE,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0xFE,0x00,0x00,0x00,
0x80,0x40,0x30,0x0F,0x02,0x02,0x02,0x02,0x02,0x02,0x42,0x82,0x7F,0x00,0x00,0x00};/*"月",1*/
uchar code str14[] ={0x00,0x00,0x00,0xFE,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0xFE,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0xFF,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0xFF,0x00,0x00,0x00,0x00};/*"日",2*/
uchar code str15[] ={0x80,0x80,0xBE,0xAA,0xAA,0xAA,0xBE,0x80,0x02,0xF2,0x1A,0xD6,0x12,0xF2,0x02,0x00,
0x80,0x60,0x1C,0x20,0x7F,0x44,0x44,0x44,0x50,0x4B,0x44,0x43,0x44,0x4B,0x50,0x00};/*"题",0*/
uchar code str16[] ={0x80,0x82,0x82,0x82,0xFE,0x82,0x82,0x82,0x82,0x82,0xFE,0x82,0x82,0x82,0x80,0x00,
0x00,0x80,0x40,0x30,0x0F,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00};/*"开",0*/
uchar code str17[] ={0x10,0x10,0xF0,0x1F,0x10,0xF0,0x00,0x40,0xE0,0x58,0x47,0x40,0x50,0x60,0xC0,0x00,
0x40,0x22,0x15,0x08,0x16,0x21,0x00,0x00,0xFE,0x42,0x42,0x42,0x42,0xFE,0x00,0x00};/*"始",1*/
uchar code str18[] ={0x80,0x80,0x80,0xBE,0xA2,0xA2,0xA2,0xA2,0xA2,0xA2,0xA2,0xBE,0x80,0x80,0x80,0x00,
0x00,0x00,0x00,0x06,0x05,0x04,0x04,0x04,0x44,0x84,0x44,0x3C,0x00,0x00,0x00,0x00};/*"号",0*/
uchar code str19[] ={0x40,0x40,0x42,0xCC,0x00,0x50,0x4E,0xC8,0x48,0x7F,0xC8,0x48,0x48,0x40,0x00,0x00,
0x00,0x40,0x20,0x1F,0x20,0x50,0x4C,0x43,0x40,0x40,0x4F,0x50,0x50,0x5C,0x40,0x00};/*"选",1*/
uchar code str20[] ={0x00,0x00,0x24,0x24,0x24,0x24,0x24,0xFC,0x22,0x22,0x22,0x23,0x22,0x00,0x00,0x00,
0x02,0x02,0x02,0x02,0x02,0x42,0x82,0x7F,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x00};/*"手",2*/
uchar code str21[] ={0x00,0x00,0xF8,0x88,0x88,0x88,0x88,0x08,0x08,0xFF,0x08,0x09,0x0A,0xC8,0x08,0x00,
0x80,0x60,0x1F,0x00,0x10,0x20,0x1F,0x80,0x40,0x21,0x16,0x18,0x26,0x41,0xF8,0x00};/*"成",3*/
uchar code str22[] ={0x08,0x08,0x08,0xF8,0x08,0x08,0x08,0x10,0x10,0xFF,0x10,0x10,0x10,0xF0,0x00,0x00,
0x10,0x30,0x10,0x1F,0x08,0x88,0x48,0x30,0x0E,0x01,0x40,0x80,0x40,0x3F,0x00,0x00};/*"功",4*/
uchar code str23[] ={0x40,0x42,0xCC,0x00,0x04,0x24,0x24,0x24,0xFF,0x24,0x24,0x24,0x24,0x04,0x00,0x00,
0x40,0x20,0x1F,0x20,0x41,0x41,0x41,0x41,0x7F,0x41,0x41,0x49,0x51,0x4F,0x40,0x00};/*"违",0*/
uchar code str24[] ={0x80,0x88,0x88,0xFF,0x88,0x88,0x80,0xFE,0x02,0x02,0xF2,0x02,0x02,0xFE,0x00,0x00,
0x40,0x20,0x18,0x07,0x08,0xB0,0x40,0x23,0x18,0x06,0x01,0x7E,0x80,0x83,0xE0,0x00};/*"规",1*/
uchar code str25[] ={0x80,0x40,0x20,0x90,0x88,0x86,0x80,0x80,0x80,0x83,0x8C,0x10,0x20,0x40,0x80,0x00,
0x00,0x80,0x40,0x20,0x18,0x07,0x00,0x40,0x80,0x40,0x3F,0x00,0x00,0x00,0x00,0x00};/*"分",0*/
uchar code str26[] ={0x90,0x52,0x34,0x10,0xFF,0x10,0x34,0x52,0x80,0x70,0x8F,0x08,0x08,0xF8,0x08,0x00,
0x82,0x9A,0x56,0x63,0x22,0x52,0x8E,0x00,0x80,0x40,0x33,0x0C,0x33,0x40,0x80,0x00};/*"数",1*/
uchar code str27[] ={0x00,0x00,0xFE,0x02,0x02,0xF2,0x12,0x12,0x12,0xF2,0x02,0x02,0xFE,0x00,0x00,0x00,
0x00,0x00,0x7F,0x20,0x20,0x27,0x24,0x24,0x24,0x27,0x20,0x20,0x7F,0x00,0x00,0x00};/*"回",0*/
uchar code str28[] ={0x00,0x02,0x02,0xC2,0x02,0x02,0x02,0xFE,0x82,0x82,0x82,0x82,0x82,0x02,0x00,0x00,
0x40,0x40,0x40,0x7F,0x40,0x40,0x40,0x7F,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00};/*"正",1*/
uchar code str29[] ={0x04,0x84,0xE4,0x5C,0x44,0xC4,0x20,0x10,0xE8,0x27,0x24,0xE4,0x34,0x2C,0xE0,0x00,
0x02,0x01,0x7F,0x10,0x10,0x3F,0x80,0x60,0x1F,0x09,0x09,0x3F,0x49,0x89,0x7F,0x00};/*"确",2*/
uchar code str30[] ={0x40,0x30,0xEF,0x24,0x64,0x48,0x48,0x7F,0x48,0x48,0x48,0x7F,0x48,0x48,0x40,0x00,
0x01,0x01,0x7F,0x21,0x11,0x00,0xFF,0x49,0x49,0x49,0x49,0x49,0xFF,0x00,0x00,0x00};/*"错",3*/
uchar code str31[] ={0x40,0x42,0xCC,0x00,0x00,0x80,0x9E,0x92,0x92,0x92,0x92,0x92,0x9E,0x80,0x00,0x00,
0x00,0x00,0x7F,0x20,0x94,0x84,0x44,0x24,0x14,0x0F,0x14,0x24,0x44,0x84,0x84,0x00};/*"误",4*/
uchar code str32[] ={0x82,0x9A,0x96,0x93,0xFA,0x52,0x52,0x80,0x7E,0x12,0x12,0x12,0xF1,0x11,0x10,0x00,
0x00,0x01,0x00,0xFE,0x93,0x92,0x93,0x92,0x92,0x92,0x92,0xFE,0x03,0x00,0x00,0x00};/*"暂",0*/
uchar code str33[] ={0x80,0x60,0xF8,0x07,0x00,0x04,0x74,0x54,0x55,0x56,0x54,0x54,0x74,0x04,0x00,0x00,
0x00,0x00,0xFF,0x00,0x03,0x01,0x05,0x45,0x85,0x7D,0x05,0x05,0x05,0x01,0x03,0x00};/*"停",1*/
uchar code str34[] ={0x20,0x30,0xAC,0x63,0x20,0x18,0x08,0x48,0x48,0x48,0x7F,0x48,0x48,0x48,0x08,0x00,
0x22,0x67,0x22,0x12,0x12,0x12,0x00,0xFE,0x42,0x42,0x42,0x42,0x42,0xFE,0x00,0x00};/*"结",2*/
uchar code str35[] ={0x04,0x04,0xE4,0x24,0x24,0x24,0x24,0xFF,0x24,0x24,0x24,0x24,0xE4,0x04,0x04,0x00,
0x40,0x40,0x27,0x22,0x12,0x0A,0x06,0xFF,0x06,0x0A,0x12,0x22,0x27,0x40,0x40,0x00};/*"束",3*/
uchar code str36[] ={0x00,0xF8,0x01,0x06,0x00,0xF0,0x12,0x12,0x12,0xF2,0x02,0x02,0x02,0xFE,0x00,0x00,
0x00,0xFF,0x00,0x00,0x00,0x1F,0x11,0x11,0x11,0x1F,0x00,0x40,0x80,0x7F,0x00,0x00};/*"间",0*/
uchar code mao[] ={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x36,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};/*":",0*/
uchar code char1[] ={0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x33,0x24,0x24,0x24,0x24,0x19,0x00};/*"s",0*/
uchar mode=0;//模式 0:停止 1:抢答 2:答题
uchar flag=0;//暂停模式
uchar time=0;//系统定时
uchar sec=0;//延时
uchar num=0;//选手编号
uchar miao1=0,miao=0;//倒计时
uchar shi1=0,shi2=0;//抢答+答题计时
uchar fen[]={10,10,10,10,10,10,10,10};//分数
uchar cha=0;//查看模式
uchar beep_time=0;//蜂鸣器控制
//清空显示
void clear()
{
lcd_clear(0); // 清屏
lcd_set_line(0); // 设置起始行为0
}