//本程序是基于51單片機(jī)的,可由矩陣鍵盤設(shè)置TLC5615 ad芯片要輸出的電壓值,//并由1602液晶屏顯示輸入的電壓值.//完整代碼下載: http://www.51hei.com/f/TLC56151602.rar //此程序測(cè)試成功,51hei版權(quán)所有,如果需要應(yīng)用到你的項(xiàng)目中只需更改端口即可#include "reg51.h"#include"intrins.h" //_nop_();延時(shí)函數(shù)用#define uchar unsigned char#define uint unsigned intsbit CLK=P2^5; //三線控制sbit DIN=P2^4;sbit CS=P2^6;sbit rs=P0^0;//命令/數(shù)據(jù)選擇sbit rw=P0^1;//讀寫口sbit e=P0^2; //鎖存控制uchar data dis1[15]={"output volt is:"}; //顯示兩行uchar data dis2[13]={".V"};float vout;//系統(tǒng)輸出電壓int shuzi;//給da數(shù)字量int ge,shifen,baifen;//定義個(gè)位十分位百分位unsigned int Data[10] = {0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,0x0038,0x0039};//延時(shí)函數(shù)delay(uint z){uint i,j;for(i=0;i
評(píng)論