资源简介
MAX44009驱动STM32F4源码,包括IIC底层驱动,MAX44009数据采集与处理

代码片段和文件信息
#include “sys.h“
#include “delay.h“
#include “usart.h“
#include “led.h“
#include “MAX44009.h“
#include “exti.h“
extern u8 High_LuxLow_Lux;
int main(void)
{
u8 exponentmantissa;
float result;
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);//设置系统中断优先级分组2
EXTIX_Init(); //初始化外部中断输入
uart_init(115200);
delay_init(168); //初始化延时函数
LED_Init(); //初始化LED端口
MAX44009_Init();//delay_ms(10);
MAX44009_WriteOneByte(0x020x80);//连续转换、手动模式、积分时间6.25MS
// MAX44009_WriteOneByte(0x050x55);
// MAX44009_WriteOneByte(0x060x66);
// MAX44009_WriteOneByte(0x070x77);
//MAX44009_WriteOneByte(0x010x01);//使能max44009中断
while(1)
{
//LED0=~LED0;
//Uart1_PutChar(0x55);
//Uart1_PutChar(MAX44009_ReadOneByte(0x00));
//Uart1_PutChar(MAX44009_ReadOneByte(0x01));
//MAX44009_WriteOneByte(0x020x80);
//Uart1_PutChar(MAX44009_ReadOneByte(0x02));
//Uart1_PutChar(MAX44009_ReadOneByte(0x03));
//Uart1_PutChar(MAX44009_ReadOneByte(0x04));
MAX44009_ReadLux(0x030x04);
//Uart1_PutChar(High_Lux);
//Uart1_PutChar(Low_Lux);
exponent = (High_Lux & 0xF0) >> 4;
mantissa = (High_Lux & 0x0F) << 4;
mantissa += Low_Lux & 0x0F;
result = mantissa * (1 << exponent) * 0.045;
printf(“\r\n光传感测试值: %f\n“result);
// Uart1_PutChar(MAX44009_ReadOneByte(0x05));
// Uart1_PutChar(MAX44009_ReadOneByte(0x06));
// Uart1_PutChar(MAX44009_ReadOneByte(0x07));
delay_ms(1000);
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3835 2017-11-23 13:55 MAX44009.c
文件 606 2017-11-14 16:30 MAX44009.h
文件 1395 2017-11-23 10:48 myiic.h
文件 1534 2017-11-23 15:09 main.c
文件 3333 2017-11-23 14:21 myiic.c
----------- --------- ---------- ----- ----
10703 5
- 上一篇:黄金外汇原油20年一分钟走势数据,需要的进来
- 下一篇:易语言Winsocket模块
相关资源
- Scratch源码
- 基于STM32RCT6的步进电机驱动程序
- E4A无障碍跨程序操作类库(带源码、
- 设备管理系统源码
- 安卓wifi直连app源码
- 我的世界源码(易语言版)
- labview编程软件滤波器以及编写程序设
- 我的界面(visual foxpro)源码
- 易语言:一键cf基址源码
- 直流无刷电机方波驱动 stm32 例程代码
- The Secret Path 3D 3D魔方迷宫[源码][scra
- scratch垃圾分类源码(最终版本).sb
- elantech触控板驱动程序 v13.6.11 官方最
- 联想y470无线网卡驱动 for 32位64位
- 松下plc FP-XH的驱动
- IMX385驱动代码.zip
- 安卓QQ6.71协议源码易语言,qq协议源码
- 编译原理实验工具及参考源码(lex&
- E盾偷后台工具源码
- 组态王驱动开发包3.0.0.7(中文)
- 飞思卡尔单片机MC9S12XS12G128驱动(硬件
- CASS9.1最新S4数据及驱动+ET199数据及驱
- UNIX/LINUX编程实践教程的源码
- 带有死区延时的H桥直流电机驱动电路
- 十以内加减法练习 powerbuilder源码
- USB转串口驱动,FT232R驱动程序,最新
- 农场开发项目
- OCR源码
- PLC上位机编程软件
- 用foobar2000听google音乐[更新一下]
评论
共有 条评论