下载手机汽配人

求基于STC单片机ADXL335角度传感器测角度的C语言程序

现成的模块,求程序
问 提问者:网友 2018-08-05
最佳回答
自己去看看吧,不要着急。 //***************************************************** //名称:单片机串口输出ADXL335角度值 //使用单片机:stc12c5a60s2 //供电:电压5v //晶振:11.0592m //X轴->(ADC0)P1.0 //Y轴->(ADC1)P1.1 //Z轴->(ADC1)P1.2 //用pc串口助手显示时,选择字符显示 //参考宏晶网址例程 //***************************************************** #include "reg51.h" #include "intrins.h" #include //Keil library #include //Keil library //#define FOSC 18432000L #define FOSC 11059200L //晶振11.0592M #define BAUD 9600 typedef unsigned char BYTE; typedef unsigned int WORD; #define uchar unsigned char #define uint unsigned int /*Declare SFR associated with the ADC */ sfr AUXR1 = 0XA2; sfr ADC_CONTR = 0xBC; //ADC control register sfr ADC_RES = 0xBD; //ADC high 8-bit result register sfr ADC_RESL = 0xBE; sfr ADC_LOW2 = 0xBE; //ADC low 2-bit result register sfr P1ASF = 0x9D; //P1 secondary function control register /*Define ADC operation const for ADC_CONTR*/ #define ADC_POWER 0x80 //ADC power control bit #define ADC_FLAG 0x10 //ADC complete flag #define ADC_START 0x08 //ADC s
回答者:网友
产品精选
搜索问答
还没有汽配人账号?立即注册

我要提问

汽配限时折扣

本页是网友提供的关于“求基于STC单片机ADXL335角度传感器测角度的C语言程序”的解答,仅供您参考,汽配人网不保证该解答的准确性。