标题: AD 程序 [打印本页] 作者: hude 时间: 2010-5-17 23:02 标题: AD 程序 AD 程序参考作者: 道灼 时间: 2016-10-20 23:49
//**********AD采样**********//
#include <hidef.h> /* common defines and macros */
#include "derivative.h" /* derivative-specific definitions */
unsigned int read_data[4]={0}; //采样变量
const byte LedData[18]={0xfc,0x60,0xda,0xf2,0x66,0xb6,0xbe,0xe0,0xfe,0xf6,0xee,0x3e,0x9c,0x7a,0x9e,0x8e,0xce,0x6e} ;
/* 0 1 2 3 4 5 6 7 8 9 A B C D E F P H */
const byte Error[5] = {0xee,0xfc,0xee,0xee,0x9e};
//==============================================================
void delay(void)
{
unsigned int loop_i, loop_j;
for (loop_i=0; loop_i< 500; loop_i++)
{
for (loop_j=0; loop_j<500;loop_j++)
{
;
}
}
}
//=============================================================================
void spiDELAY(void)
{
unsigned int loop_i;
for (loop_i=0; loop_i< 100; loop_i++)
{
;
}
}
//=============================================================================
void spiWRITEbyte(unsigned int spiDATA){
unsigned int i =0;