51单片机c语言dac0832产生波形,单片机控制DAC0832产生各种波形Proteus仿真程序

#include

sbit wr=P3^6;

sbit rd=P3^2;

sbit key0=P1^0;                  //定义P1.0脚的按键为正弦波键key0

sbit key1=P1^1;                  //定义P1.1脚的按键为方波键key1

sbit key2=P1^2;                  //定义P1.2脚的按键为三角波键key2

unsigned char flag;          //flag为1、2、3是对应的正弦波、方波、三角波

unsigned char const code        //为正弦波采样点数组的256个数据

SIN_code[256]={0x80,0x83,0x86,0x89,0x8c,0x8f,0x92,0x95,0x98,0x9c,0x9f,0xa2,

0xa5,0xa8,0xab,0xae,0xb0,0xb3,0xb6,0xb9,0xbc,0xbf,0xc1,0xc4,0xc7,0xc9,0xcc,0xce,

0xd1,0xd3,0xd5,0xd8,0xda,0xdc,0xde,0xe0,0xe2,0xe4,0xe6,0xe8,0xea,0xec,0xed,0xef,

0xf0,0xf2,0xf3,0xf4,0xf6,0xf7,0xf8,0xf9,0xfa,0xfb,0xfc,0xfc,0xfd,0xfe,0xfe,0xff,

0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0xfe,0xfd,0xfc,0xfc,0xfb,

0xfa,0xf9,0xf8,0xf7,0xf6,0xf5,0xf3,0xf2,0xf0,0xef,0xed,0xec,0xea,0xe8,0xe6,0xe4,

0xe3,0xe1,0xde,0xdc,0xda,0

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值