找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 3735|回复: 7
收起左侧

基于51单片机和QJ00M02的录音笔程序+电路设计

[复制链接]
ID:414340 发表于 2019-1-2 21:21 | 显示全部楼层 |阅读模式
Altium Designer画的QJ00M02录音笔原理图如下:(51hei附件中可下载工程文件)

0.png

部分主程序:
#include "reg52.h"
#include "stdio.h"
#include "string.h"

#define uchar unsigned char
#define uint unsigned int

uchar count_chaxun; //需定义在一下几个头文件前

#include "sbit.h"
#include "lcd.h"
#include "uart.h"
#include "mp3.h"
#include "key.h"

void display()                 //显示函数
{
        switch (zhuangtai)
                {
                  
                  case 1:write_string(0x80,"      PLAY      ");        break;
                  case 2:write_string(0x80,"      STOP      ");        break;
                  case 3:write_string(0x80,"     PAUSE      ");        break;
                  case 4:write_string(0x80,"     RECORD");        break;
                }
             write_1602com(0xc0);
                 write_1602dat(dangqianqumu/100+0x30);
         write_1602dat(dangqianqumu%100/10+0x30);
         write_1602dat(dangqianqumu%10+0x30);
                 write_1602dat('/');
                write_1602com(0xc4);
                write_1602dat(zongqumu/100+0x30);
                write_1602dat(zongqumu%100/10+0x30);
                write_1602dat(zongqumu%10+0x30);
                write_1602com(0xc8);
                write_1602dat('V');
                write_1602dat(':');   
                write_1602dat(yinliang/10+0x30);
                write_1602dat(yinliang%10+0x30);
                write_string(0," M:");
                write_1602dat(moshi+0x30);
}
void main()
{
    Uart_init();        //定时器、串口初始化
    lcd_init();                //LCD1602初始化
        delay(1000);
        write_1602com(0x01);
    write_1602com(0xcf);
    write_1602dat(moshi+0x30);
        shezhiyinliang(10);           //设置音量
        delay(100);
    chaxunyinliang();           //查询音量
         delay(100);
        chaxunzongmu();            //查询音乐\录音文件总数
         delay(100);
        while(1)
        {
                     
                keyscan();                //键扫描
                display();
                if(count_chaxun==25)
                {
                count_chaxun=0;
                TR0=0;                           //关闭定时器0
                chaxundangmu();           //查询当前曲目
                delay(100);
                count_chaxun=0;
                chaxun();                  //查询当前播放状态
            TR0=1;                          //启动定时器0
                }
               
        
        }

}
void timer0() interrupt 1
{
          TH0=0x4c;
        TL0=0x00;                //T0赋初值40ms
        count_chaxun++;
        if(count_chaxun>25)

        count_chaxun=25 ;
}

全部资料51hei下载地址:
程序.rar (50.89 KB, 下载次数: 53)
回复

使用道具 举报

ID:275746 发表于 2019-3-21 10:09 | 显示全部楼层
感谢分享
回复

使用道具 举报

ID:539198 发表于 2019-5-15 19:29 | 显示全部楼层

感谢分享
回复

使用道具 举报

ID:448822 发表于 2019-5-16 08:59 | 显示全部楼层
感谢分享
回复

使用道具 举报

ID:539198 发表于 2019-5-17 18:21 | 显示全部楼层
这个怎么实现的声音的录制与播放的?
回复

使用道具 举报

ID:758167 发表于 2020-5-22 11:39 | 显示全部楼层
感谢分享
回复

使用道具 举报

ID:875385 发表于 2021-1-9 20:52 | 显示全部楼层
你好,请问你有QJ000M02的芯片手册吗
回复

使用道具 举报

ID:875382 发表于 2021-5-15 22:22 | 显示全部楼层
count_chaxun=0;是什么意思呢?发现好多这个
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

快速回复 返回顶部 返回列表