Renesas MCU使用SCI_I2C驱动OLED

目录

概述

1 软硬件

 1.1 软件版本信息

1.2 OLED屏幕

1.2.1 OLED简介

1.2.2 SSD1306介绍

1.2.3 0.9寸OLED模块介绍

 2 FSP配置项目

2.1 配置项目参数

 2.2 生成项目文件架构

3 代码实现

3.1 I2C的库函数

3.1.1 R_SCI_I2C_Open()

3.1.2 R_SCI_I2C_Read()

3.1.3  R_SCI_I2C_Write()

3.2 应用函数接口

3.2.1 初始化函数

3.2.2 读数据函数

 3.2.3 写数据函数

3.2.4 回调函数

4 OLED驱动实现

4.1 编写驱动程序

4.2 编写测试函数

4.3 源代码

5 测试


概述

本文主要介绍使用Renesas MCU的SCI_I2C模块驱动OLED,文中介绍了OLED的相关知识,包括模块参数,接口信息,还介绍了FSP库中I2C相关的接口函数。最后使用HS3003采集环境温湿度数据,并在OLED UI上显示出来。

1 软硬件

 1.1 软件版本信息

软硬件信息版本信息
Renesas MCUR7FA4M2AD3C
KeilMDK ARM 5.38
FSP 版本5.3.0
调试工具:st-linkST-LINK/V2-1

 注意:

在Keil MDK中可以更改FSP的版本,方法如下

1.2 OLED屏幕

1.2.1 OLED简介

     OLED(有机发光二极管)是一种显示技术,它使用有机物质来发出光线。与传统液晶显示屏相比,OLED具有更高的对比度和更广的视角。它没有背光源,因此可以提供更深的黑色和更明亮的白色。

       OLED显示屏由许多小的发光二极管组成,每个像素都可以独立发光。这意味着OLED显示屏可以实现真正的黑色,因为当像素关闭时,没有任何光线发射。

     OLED具有快速的响应时间,因此在显示动态图像时可以提供更流畅的画面。此外,OLED显示屏拥有更宽广的视角,因此无论从哪个角度观看,图像都能保持清晰和准确。

      OLED显示屏还具有较高的能源效率。因为每个像素都可以独立点亮,所以在显示黑色时可以关闭相应的像素,从而节省能源。

      OLED技术可应用于各种设备,包括智能手机、电视、电子书阅读器、车载显示屏等。由于OLED显示屏的薄度和柔性,它还可以用于可弯曲的显示设备和可穿戴设备。

       然而,OLED显示屏也有一些限制。首先,长时间显示相同的图像可能会导致“烧结”效应,即在屏幕上留下轮廓。其次,OLED显示屏的寿命相对较短,使用寿命通常较液晶显示屏更短。

      总的来说,OLED技术在显示领域具有许多优势,如高对比度、广视角和能源效率。随着技术的不断发展,OLED显示屏将在各种设备中得到更广泛的应用。

1.2.2 SSD1306介绍

      SSD1306是一款常用的单色OLED驱动芯片,由Solomon Systech Limited(国巨控股)设计和生产。它被广泛应用于各种嵌入式系统和电子设备中,用于驱动OLED显示屏。

      SSD1306采用低功耗、高对比度和快速刷新率的技术,使得显示效果清晰亮丽。它具备128x64或128x32像素的分辨率,并支持四种显示模式:正常显示、反转显示、镜像显示和指令显示。SSD1306还可以通过I2C或SPI接口与微控制器或其他外部设备进行通信。

      SSD1306内置了丰富的图形绘制和文本显示功能,可以轻松实现直线、矩形、圆形、位图等图形的绘制,以及字符、数字和自定义字体的显示。它还提供了多种显示模式和亮度调节选项,可以根据实际需求灵活控制显示效果。

      SSD1306还具备内置的电源管理功能,支持低电压检测和电池电量显示,可以实现智能电源管理。此外,它还支持多种硬件和软件配置选项,方便用户进行定制化开发。

      总的来说,SSD1306是一款功能强大、易于使用的OLED驱动芯片,适用于各种嵌入式系统和电子设备中,能够实现高质量、低功耗的显示效果。

1.2.3 0.9寸OLED模块介绍

笔者使用的0.9寸OLED模块, 驱动芯片为SSD1306,该模块采用I2C驱动方式,对外有四个引脚:

1) GND: 电源地

2)VCC: 电源正极 ,工作电压区间为3~5.5V

3)SCL: I2C 时钟引脚

4) SDA: I2C数据引脚

模块的原理图如下:

 2 FSP配置项目

2.1 配置项目参数

1)配置系统时钟,根据硬件特性配置时钟,笔者的板卡上的晶振为12M Hz

 2) 在Pins面板配置SCI3,使能I2C,并且配置IO端口

3)在Stacks面板创建i2c的object

 配置参数

 2.2 生成项目文件架构

点击Generate Project content 按钮,生成项目文件,其文件架构如下:

3 代码实现

3.1 I2C的库函数

3.1.1 R_SCI_I2C_Open()

函数原型:


fsp_err_t R_SCI_I2C_Open	(	i2c_master_ctrl_t *const 	p_api_ctrl,i2c_master_cfg_t const *const 	p_cfg )	

函数功能: 打开I2C设备

返回值介绍:

FSP_SUCCESSRequested clock rate was set exactly.
FSP_ERR_ALREADY_OPENModule is already open.
FSP_ERR_IP_CHANNEL_NOT_PRESENTChannel is not available on this MCU.
FSP_ERR_ASSERTIONParameter check failure due to one or more reasons below:
  1. p_api_ctrl or p_cfg is NULL.
  2. extended parameter is NULL.
  3. Callback parameter is NULL.
  4. Clock rate requested is greater than 400KHz
  5. Invalid IRQ number assigned

3.1.2 R_SCI_I2C_Read()

函数原型:


fsp_err_t R_SCI_I2C_Read	(	i2c_master_ctrl_t *const 	p_api_ctrl,uint8_t *const 	p_dest,uint32_t const 	bytes,bool const 	restart )	

函数功能: 从I2C设备执行读取操作。当操作(成功)完成时,调用者将通过回调中的I2C_MASTER_EVENT_RX_COMPLETE收到通知。

返回值:

FSP_SUCCESSFunction executed without issue.
FSP_ERR_ASSERTIONThe parameter p_ctrl, p_dest is NULL, bytes is 0.
FSP_ERR_INVALID_SIZEProvided number of bytes more than uint16_t size (65535) while DTC is used for data transfer.
FSP_ERR_NOT_OPENDevice was not even opened.

3.1.3  R_SCI_I2C_Write()

函数原型:


fsp_err_t R_SCI_I2C_Write	(	i2c_master_ctrl_t *const 	p_api_ctrl,uint8_t *const 	p_src,uint32_t const 	bytes,bool const 	restart )	

函数功能: 对I2C设备进行写操作,如果相关通道上已经有正在进行的I2C传输,则此函数将失败。否则,将开始I2C写操作。当用户没有提供回调时,该函数执行阻塞写入。否则,写操作是非阻塞的,并且当操作完成时将通过回调中的I2C_EVENT_TX_COMPLETE通知调用者。

返回值:

FSP_SUCCESSFunction executed without issue.
FSP_ERR_ASSERTIONp_ctrl, p_src is NULL.
FSP_ERR_INVALID_SIZEProvided number of bytes more than uint16_t size (65535) while DTC is used for data transfer.
FSP_ERR_NOT_OPENDevice was not even opened.

3.2 应用函数接口

创建bsp_i2c.c文件,实现i2c的应用函数接口

3.2.1 初始化函数

代码第24行:打开端口

代码第27行:设置设备地址

3.2.2 读数据函数

代码第54行:从设备中读取数据

代码第57行:判断接收数据是否完成

 3.2.3 写数据函数

代码第36行:从设备中写数据

代码第41行:判断写数据是否完成

3.2.4 回调函数

代码第16行:接收当前event

 

4 OLED驱动实现

4.1 编写驱动程序

1)创建oled_drv.c文件,编写如下代码:

/** \file$Id: oled.c 40486 2018-08-12 13:50:21Z tangmingfei2013@126.com $Copyright (c)tangmingfei2013@126.com Holding B.V.
All Rights Reserved.This source code and any compilation or derivative thereof is the proprietary
information of mingfei.tang Holding B.V. and is confidential in nature.
Under no circumstances is this software to be combined with any
Open Source Software in any way or placed under an Open Source License
of any type without the express written permission of mingfei.tang Holding B.V.
*/
/*******************************************************************************
* EXPORT INCLUDE FILES
*******************************************************************************/
#include "bsp_i2c.h" 
#include "oled_drv.h"
/*******************************************************************************
* LOCAL INCLUDE FILES
*******************************************************************************/
#include "font.h"static uint8_t charSize;
/******************************************************************************
* LOCAL FUNCTION DECLARATIONS
******************************************************************************/
static void oled_WriteRegister(uint8_t val,  uint8_t reg);/******************************************************************************
* EXPORTED FUNCTIONS
******************************************************************************/
void oled_Init(void)
{ i2c2_init_para(OLED_ADDRESS);oled_WriteRegister(0xAE,PARA);//--display offoled_WriteRegister(0x00,PARA);//---set low column addressoled_WriteRegister(0x10,PARA);//---set high column addressoled_WriteRegister(0x40,PARA);//--set start line address  oled_WriteRegister(0xB0,PARA);//--set page addressoled_WriteRegister(0x81,PARA); // contract controloled_WriteRegister(0xFF,PARA);//--128   oled_WriteRegister(0xA1,PARA);//set segment remap oled_WriteRegister(0xA6,PARA);//--normal / reverseoled_WriteRegister(0xA8,PARA);//--set multiplex ratio(1 to 64)oled_WriteRegister(0x3F,PARA);//--1/32 dutyoled_WriteRegister(0xC8,PARA);//Com scan directionoled_WriteRegister(0xD3,PARA);//-set display offsetoled_WriteRegister(0x00,PARA);//oled_WriteRegister(0xD5,PARA);//set osc divisionoled_WriteRegister(0x80,PARA);//oled_WriteRegister(0xD8,PARA);//set area color mode offoled_WriteRegister(0x05,PARA);//oled_WriteRegister(0xD9,PARA);//Set Pre-Charge Periodoled_WriteRegister(0xF1,PARA);//oled_WriteRegister(0xDA,PARA);//set com pin configuartionoled_WriteRegister(0x12,PARA);//oled_WriteRegister(0xDB,PARA);//set Vcomholed_WriteRegister(0x30,PARA);//oled_WriteRegister(0x8D,PARA);//set charge pump enableoled_WriteRegister(0x14,PARA);//oled_WriteRegister(0xAF,PARA);//--turn on oled paneloled_Clear();#if OLED_DEBUG  oled_SetCharSize( FONT_16 );  oled_PrintfString(6,0,(uint8_t*)"0.96' OLED TEST");  oled_SetCharSize( FONT_12 );oled_PrintfString(2,6,(uint8_t*)"ASCII:");  oled_PrintfString(60,6,(uint8_t*)"-CODE:");
#endif} void oled_SetCharSize( uint8_t val )
{charSize = val;
}void oled_SetPostion( uint8_t x, uint8_t y) 
{oled_WriteRegister(0xb0+y,PARA);oled_WriteRegister(((x&0xf0)>>4)|0x10,PARA);oled_WriteRegister((x&0x0f),PARA); 
}void oled_displayOn(void)
{oled_WriteRegister(0X8D,PARA); oled_WriteRegister(0X14,PARA); oled_WriteRegister(0XAF,PARA);
}void oled_DisplayOff(void)
{oled_WriteRegister(0X8D,PARA);oled_WriteRegister(0X10,PARA);oled_WriteRegister(0XAE,PARA);
}void oled_Clear(void)  
{  uint8_t i,n;for(i=0;i<8;i++)  {  oled_WriteRegister (0xb0+i,PARA);   oled_WriteRegister (0x00,PARA);oled_WriteRegister (0x10,PARA); for( n = 0;n < 128; n++){oled_WriteRegister(0,DATA);} } 
}void oled_UpScreenOn(void)  
{  uint8_t i,n;for(i=0;i<8;i++)  {  oled_WriteRegister (0xb0+i,PARA);oled_WriteRegister (0x00,PARA); oled_WriteRegister (0x10,PARA);for(n=0;n<128;n++){oled_WriteRegister(1,DATA); }} 
}void oled_PrintfChar(uint8_t x,uint8_t y,uint8_t val )
{      	uint8_t character = 0;uint8_t i=0;character = val-' ';if( x > X_WIDTH-1){x = 0;y += 2;}if( charSize == FONT_16 ){oled_SetPostion(x,y);	for( i = 0; i < 8; i++){oled_WriteRegister(F8X16[character*16+i],DATA);}oled_SetPostion(x,y+1);for(i=0;i<8;i++){oled_WriteRegister(F8X16[character*16+i+8],DATA);}}else {oled_SetPostion(x,y);for(i=0;i<6;i++){oled_WriteRegister(F6x8[character*6+i],DATA);}}
}void oled_PrintfString(uint8_t x,uint8_t y,uint8_t *str  )
{uint8_t index = 0;while ( str[index]!='\0' ){oled_PrintfChar(x,y,str[index] );x += 8;if( x > 120 ){  x=0;y+=2;}index++;}
}void oled_PrintmutiChar(uint8_t x,uint8_t y,uint8_t *str,  uint8_t length )
{for(uint8_t index = 0; index < length; index++ ){oled_PrintfChar(x,y,str[index] );x += 8;if( x > 120 ){  x=0;y+=2;}}
}/******************************************************************************
* LOCAL FUNCTIONS
******************************************************************************/
static void oled_WriteRegister(uint8_t val,  uint8_t reg)
{  fsp_err_t err;unsigned char buff[2];err = R_SCI_I2C_SlaveAddressSet( &g_i2c2_ctrl, OLED_ADDRESS, I2C_MASTER_ADDR_MODE_7BIT);assert(FSP_SUCCESS == err);buff[0] = reg;buff[1] = val;i2c2_write_bytes(buff, 2);
}
/* End of this file */

2)创建oled_drv.h文件,编写如下代码:

/** \file$Id: oled.h 40486 2018-08-12 13:50:21Z tangmingfei2013@126.com $Copyright (c)tangmingfei2013@126.com Holding B.V.
All Rights Reserved.This source code and any compilation or derivative thereof is the proprietary
information of mingfei.tang Holding B.V. and is confidential in nature.
Under no circumstances is this software to be combined with any
Open Source Software in any way or placed under an Open Source License
of any type without the express written permission of mingfei.tang Holding B.V.
*/
#ifndef __OLED_DRV_H
#define __OLED_DRV_H/******************************************************************************
* C++ DECLARATION WRAPPER
******************************************************************************/#ifdef __cplusplus
extern "C" {
#endif#include "hal_data.h"
/******************************************************************************
* LOCAL MACROS AND DEFINITIONS
******************************************************************************/
#define OLED_DEBUG      1
#define OLED_ADDRESS    0x3ctypedef enum
{FONT_16 = 0,FONT_12 = 1,
}OLED_CHARSIZE;typedef enum
{PARA = 0,DATA = 0x40,
}OLED_PARE_REG;typedef enum
{X_WIDTH = 128,Y_WIDTH = 64,
}OLED_SCREEN_SIZE;/******************************************************************************
* EXPORTED MACROS AND DEFINITIONS
******************************************************************************/ /******************************************************************************
* EXPORTED FUNCTIONS
******************************************************************************/
void oled_Clear(void) ;
void oled_Init(void);
void oled_UpScreenOn(void);void oled_PrintfString(uint8_t x,uint8_t y,uint8_t *str);
void oled_PrintfChar(uint8_t x,uint8_t y,uint8_t val);
void oled_SetPostion( uint8_t x, uint8_t y) ;
void oled_SetCharSize( uint8_t val );
void oled_PrintmutiChar(uint8_t x,uint8_t y,uint8_t *str,  uint8_t length);/******************************************************************************
* END OF C++ DECLARATION WRAPPER
******************************************************************************/#ifdef __cplusplus
}
#endif#endif /* __OLED_DRV_H */

3) 创建font.h文件,编写如下代码:

/** \file$Id: font.h 40486 2018-08-12 13:50:21Z tangmingfei2013@126.com $Copyright (c)tangmingfei2013@126.com Holding B.V.
All Rights Reserved.This source code and any compilation or derivative thereof is the proprietary
information of mingfei.tang Lighting Holding B.V. and is confidential in nature.
Under no circumstances is this software to be combined with any
Open Source Software in any way or placed under an Open Source License
of any type without the express written permission of mingfei.tang Holding B.V.
*/#ifndef __FONT_H
#define __FONT_H/*******************************************************************************
* EXPORT INCLUDE FILES
*******************************************************************************//******************************************************************************
* C++ DECLARATION WRAPPER
******************************************************************************/
#ifdef __cplusplus
extern "C" {
#endifconst unsigned char F6x8[] =
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,// sp
0x00, 0x00, 0x00, 0x2f, 0x00, 0x00,// !
0x00, 0x00, 0x07, 0x00, 0x07, 0x00,// "
0x00, 0x14, 0x7f, 0x14, 0x7f, 0x14,// #
0x00, 0x24, 0x2a, 0x7f, 0x2a, 0x12,// $
0x00, 0x62, 0x64, 0x08, 0x13, 0x23,// %
0x00, 0x36, 0x49, 0x55, 0x22, 0x50,// &
0x00, 0x00, 0x05, 0x03, 0x00, 0x00,// '
0x00, 0x00, 0x1c, 0x22, 0x41, 0x00,// (
0x00, 0x00, 0x41, 0x22, 0x1c, 0x00,// )
0x00, 0x14, 0x08, 0x3E, 0x08, 0x14,// *
0x00, 0x08, 0x08, 0x3E, 0x08, 0x08,// +
0x00, 0x00, 0x00, 0xA0, 0x60, 0x00,// ,
0x00, 0x08, 0x08, 0x08, 0x08, 0x08,// -
0x00, 0x00, 0x60, 0x60, 0x00, 0x00,// .
0x00, 0x20, 0x10, 0x08, 0x04, 0x02,// /
0x00, 0x3E, 0x51, 0x49, 0x45, 0x3E,// 0
0x00, 0x00, 0x42, 0x7F, 0x40, 0x00,// 1
0x00, 0x42, 0x61, 0x51, 0x49, 0x46,// 2
0x00, 0x21, 0x41, 0x45, 0x4B, 0x31,// 3
0x00, 0x18, 0x14, 0x12, 0x7F, 0x10,// 4
0x00, 0x27, 0x45, 0x45, 0x45, 0x39,// 5
0x00, 0x3C, 0x4A, 0x49, 0x49, 0x30,// 6
0x00, 0x01, 0x71, 0x09, 0x05, 0x03,// 7
0x00, 0x36, 0x49, 0x49, 0x49, 0x36,// 8
0x00, 0x06, 0x49, 0x49, 0x29, 0x1E,// 9
0x00, 0x00, 0x36, 0x36, 0x00, 0x00,// :
0x00, 0x00, 0x56, 0x36, 0x00, 0x00,// ;
0x00, 0x08, 0x14, 0x22, 0x41, 0x00,// <
0x00, 0x14, 0x14, 0x14, 0x14, 0x14,// =
0x00, 0x00, 0x41, 0x22, 0x14, 0x08,// >
0x00, 0x02, 0x01, 0x51, 0x09, 0x06,// ?
0x00, 0x32, 0x49, 0x59, 0x51, 0x3E,// @
0x00, 0x7C, 0x12, 0x11, 0x12, 0x7C,// A
0x00, 0x7F, 0x49, 0x49, 0x49, 0x36,// B
0x00, 0x3E, 0x41, 0x41, 0x41, 0x22,// C
0x00, 0x7F, 0x41, 0x41, 0x22, 0x1C,// D
0x00, 0x7F, 0x49, 0x49, 0x49, 0x41,// E
0x00, 0x7F, 0x09, 0x09, 0x09, 0x01,// F
0x00, 0x3E, 0x41, 0x49, 0x49, 0x7A,// G
0x00, 0x7F, 0x08, 0x08, 0x08, 0x7F,// H
0x00, 0x00, 0x41, 0x7F, 0x41, 0x00,// I
0x00, 0x20, 0x40, 0x41, 0x3F, 0x01,// J
0x00, 0x7F, 0x08, 0x14, 0x22, 0x41,// K
0x00, 0x7F, 0x40, 0x40, 0x40, 0x40,// L
0x00, 0x7F, 0x02, 0x0C, 0x02, 0x7F,// M
0x00, 0x7F, 0x04, 0x08, 0x10, 0x7F,// N
0x00, 0x3E, 0x41, 0x41, 0x41, 0x3E,// O
0x00, 0x7F, 0x09, 0x09, 0x09, 0x06,// P
0x00, 0x3E, 0x41, 0x51, 0x21, 0x5E,// Q
0x00, 0x7F, 0x09, 0x19, 0x29, 0x46,// R
0x00, 0x46, 0x49, 0x49, 0x49, 0x31,// S
0x00, 0x01, 0x01, 0x7F, 0x01, 0x01,// T
0x00, 0x3F, 0x40, 0x40, 0x40, 0x3F,// U
0x00, 0x1F, 0x20, 0x40, 0x20, 0x1F,// V
0x00, 0x3F, 0x40, 0x38, 0x40, 0x3F,// W
0x00, 0x63, 0x14, 0x08, 0x14, 0x63,// X
0x00, 0x07, 0x08, 0x70, 0x08, 0x07,// Y
0x00, 0x61, 0x51, 0x49, 0x45, 0x43,// Z
0x00, 0x00, 0x7F, 0x41, 0x41, 0x00,// [
0x00, 0x55, 0x2A, 0x55, 0x2A, 0x55,// 55
0x00, 0x00, 0x41, 0x41, 0x7F, 0x00,// ]
0x00, 0x04, 0x02, 0x01, 0x02, 0x04,// ^
0x00, 0x40, 0x40, 0x40, 0x40, 0x40,// _
0x00, 0x00, 0x01, 0x02, 0x04, 0x00,// '
0x00, 0x20, 0x54, 0x54, 0x54, 0x78,// a
0x00, 0x7F, 0x48, 0x44, 0x44, 0x38,// b
0x00, 0x38, 0x44, 0x44, 0x44, 0x20,// c
0x00, 0x38, 0x44, 0x44, 0x48, 0x7F,// d
0x00, 0x38, 0x54, 0x54, 0x54, 0x18,// e
0x00, 0x08, 0x7E, 0x09, 0x01, 0x02,// f
0x00, 0x18, 0xA4, 0xA4, 0xA4, 0x7C,// g
0x00, 0x7F, 0x08, 0x04, 0x04, 0x78,// h
0x00, 0x00, 0x44, 0x7D, 0x40, 0x00,// i
0x00, 0x40, 0x80, 0x84, 0x7D, 0x00,// j
0x00, 0x7F, 0x10, 0x28, 0x44, 0x00,// k
0x00, 0x00, 0x41, 0x7F, 0x40, 0x00,// l
0x00, 0x7C, 0x04, 0x18, 0x04, 0x78,// m
0x00, 0x7C, 0x08, 0x04, 0x04, 0x78,// n
0x00, 0x38, 0x44, 0x44, 0x44, 0x38,// o
0x00, 0xFC, 0x24, 0x24, 0x24, 0x18,// p
0x00, 0x18, 0x24, 0x24, 0x18, 0xFC,// q
0x00, 0x7C, 0x08, 0x04, 0x04, 0x08,// r
0x00, 0x48, 0x54, 0x54, 0x54, 0x20,// s
0x00, 0x04, 0x3F, 0x44, 0x40, 0x20,// t
0x00, 0x3C, 0x40, 0x40, 0x20, 0x7C,// u
0x00, 0x1C, 0x20, 0x40, 0x20, 0x1C,// v
0x00, 0x3C, 0x40, 0x30, 0x40, 0x3C,// w
0x00, 0x44, 0x28, 0x10, 0x28, 0x44,// x
0x00, 0x1C, 0xA0, 0xA0, 0xA0, 0x7C,// y
0x00, 0x44, 0x64, 0x54, 0x4C, 0x44,// z
0x14, 0x14, 0x14, 0x14, 0x14, 0x14,// horiz lines
};/****************************************8*16************************************/
const unsigned char F8X16[]=  
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,// 00x00,0x00,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x30,0x00,0x00,0x00,//! 10x00,0x10,0x0C,0x06,0x10,0x0C,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//" 20x40,0xC0,0x78,0x40,0xC0,0x78,0x40,0x00,0x04,0x3F,0x04,0x04,0x3F,0x04,0x04,0x00,//# 30x00,0x70,0x88,0xFC,0x08,0x30,0x00,0x00,0x00,0x18,0x20,0xFF,0x21,0x1E,0x00,0x00,//$ 40xF0,0x08,0xF0,0x00,0xE0,0x18,0x00,0x00,0x00,0x21,0x1C,0x03,0x1E,0x21,0x1E,0x00,//% 50x00,0xF0,0x08,0x88,0x70,0x00,0x00,0x00,0x1E,0x21,0x23,0x24,0x19,0x27,0x21,0x10,//& 60x10,0x16,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//' 70x00,0x00,0x00,0xE0,0x18,0x04,0x02,0x00,0x00,0x00,0x00,0x07,0x18,0x20,0x40,0x00,//( 80x00,0x02,0x04,0x18,0xE0,0x00,0x00,0x00,0x00,0x40,0x20,0x18,0x07,0x00,0x00,0x00,//) 90x40,0x40,0x80,0xF0,0x80,0x40,0x40,0x00,0x02,0x02,0x01,0x0F,0x01,0x02,0x02,0x00,//* 100x00,0x00,0x00,0xF0,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x1F,0x01,0x01,0x01,0x00,//+ 110x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xB0,0x70,0x00,0x00,0x00,0x00,0x00,//, 120x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,//- 130x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,0x00,0x00,//. 140x00,0x00,0x00,0x00,0x80,0x60,0x18,0x04,0x00,0x60,0x18,0x06,0x01,0x00,0x00,0x00,/// 150x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x0F,0x10,0x20,0x20,0x10,0x0F,0x00,//0 160x00,0x10,0x10,0xF8,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//1 170x00,0x70,0x08,0x08,0x08,0x88,0x70,0x00,0x00,0x30,0x28,0x24,0x22,0x21,0x30,0x00,//2 180x00,0x30,0x08,0x88,0x88,0x48,0x30,0x00,0x00,0x18,0x20,0x20,0x20,0x11,0x0E,0x00,//3 190x00,0x00,0xC0,0x20,0x10,0xF8,0x00,0x00,0x00,0x07,0x04,0x24,0x24,0x3F,0x24,0x00,//4 200x00,0xF8,0x08,0x88,0x88,0x08,0x08,0x00,0x00,0x19,0x21,0x20,0x20,0x11,0x0E,0x00,//5 210x00,0xE0,0x10,0x88,0x88,0x18,0x00,0x00,0x00,0x0F,0x11,0x20,0x20,0x11,0x0E,0x00,//6 220x00,0x38,0x08,0x08,0xC8,0x38,0x08,0x00,0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0x00,//7 230x00,0x70,0x88,0x08,0x08,0x88,0x70,0x00,0x00,0x1C,0x22,0x21,0x21,0x22,0x1C,0x00,//8 240x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x00,0x31,0x22,0x22,0x11,0x0F,0x00,//9 250x00,0x00,0x00,0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,//: 260x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x60,0x00,0x00,0x00,0x00,//; 270x00,0x00,0x80,0x40,0x20,0x10,0x08,0x00,0x00,0x01,0x02,0x04,0x08,0x10,0x20,0x00,//< 280x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x00,//= 290x00,0x08,0x10,0x20,0x40,0x80,0x00,0x00,0x00,0x20,0x10,0x08,0x04,0x02,0x01,0x00,//> 300x00,0x70,0x48,0x08,0x08,0x08,0xF0,0x00,0x00,0x00,0x00,0x30,0x36,0x01,0x00,0x00,//? 310xC0,0x30,0xC8,0x28,0xE8,0x10,0xE0,0x00,0x07,0x18,0x27,0x24,0x23,0x14,0x0B,0x00,//@ 320x00,0x00,0xC0,0x38,0xE0,0x00,0x00,0x00,0x20,0x3C,0x23,0x02,0x02,0x27,0x38,0x20,//A 330x08,0xF8,0x88,0x88,0x88,0x70,0x00,0x00,0x20,0x3F,0x20,0x20,0x20,0x11,0x0E,0x00,//B 340xC0,0x30,0x08,0x08,0x08,0x08,0x38,0x00,0x07,0x18,0x20,0x20,0x20,0x10,0x08,0x00,//C 350x08,0xF8,0x08,0x08,0x08,0x10,0xE0,0x00,0x20,0x3F,0x20,0x20,0x20,0x10,0x0F,0x00,//D 360x08,0xF8,0x88,0x88,0xE8,0x08,0x10,0x00,0x20,0x3F,0x20,0x20,0x23,0x20,0x18,0x00,//E 370x08,0xF8,0x88,0x88,0xE8,0x08,0x10,0x00,0x20,0x3F,0x20,0x00,0x03,0x00,0x00,0x00,//F 380xC0,0x30,0x08,0x08,0x08,0x38,0x00,0x00,0x07,0x18,0x20,0x20,0x22,0x1E,0x02,0x00,//G 390x08,0xF8,0x08,0x00,0x00,0x08,0xF8,0x08,0x20,0x3F,0x21,0x01,0x01,0x21,0x3F,0x20,//H 400x00,0x08,0x08,0xF8,0x08,0x08,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//I 410x00,0x00,0x08,0x08,0xF8,0x08,0x08,0x00,0xC0,0x80,0x80,0x80,0x7F,0x00,0x00,0x00,//J 420x08,0xF8,0x88,0xC0,0x28,0x18,0x08,0x00,0x20,0x3F,0x20,0x01,0x26,0x38,0x20,0x00,//K 430x08,0xF8,0x08,0x00,0x00,0x00,0x00,0x00,0x20,0x3F,0x20,0x20,0x20,0x20,0x30,0x00,//L 440x08,0xF8,0xF8,0x00,0xF8,0xF8,0x08,0x00,0x20,0x3F,0x00,0x3F,0x00,0x3F,0x20,0x00,//M 450x08,0xF8,0x30,0xC0,0x00,0x08,0xF8,0x08,0x20,0x3F,0x20,0x00,0x07,0x18,0x3F,0x00,//N 460xE0,0x10,0x08,0x08,0x08,0x10,0xE0,0x00,0x0F,0x10,0x20,0x20,0x20,0x10,0x0F,0x00,//O 470x08,0xF8,0x08,0x08,0x08,0x08,0xF0,0x00,0x20,0x3F,0x21,0x01,0x01,0x01,0x00,0x00,//P 480xE0,0x10,0x08,0x08,0x08,0x10,0xE0,0x00,0x0F,0x18,0x24,0x24,0x38,0x50,0x4F,0x00,//Q 490x08,0xF8,0x88,0x88,0x88,0x88,0x70,0x00,0x20,0x3F,0x20,0x00,0x03,0x0C,0x30,0x20,//R 500x00,0x70,0x88,0x08,0x08,0x08,0x38,0x00,0x00,0x38,0x20,0x21,0x21,0x22,0x1C,0x00,//S 510x18,0x08,0x08,0xF8,0x08,0x08,0x18,0x00,0x00,0x00,0x20,0x3F,0x20,0x00,0x00,0x00,//T 520x08,0xF8,0x08,0x00,0x00,0x08,0xF8,0x08,0x00,0x1F,0x20,0x20,0x20,0x20,0x1F,0x00,//U 530x08,0x78,0x88,0x00,0x00,0xC8,0x38,0x08,0x00,0x00,0x07,0x38,0x0E,0x01,0x00,0x00,//V 540xF8,0x08,0x00,0xF8,0x00,0x08,0xF8,0x00,0x03,0x3C,0x07,0x00,0x07,0x3C,0x03,0x00,//W 550x08,0x18,0x68,0x80,0x80,0x68,0x18,0x08,0x20,0x30,0x2C,0x03,0x03,0x2C,0x30,0x20,//X 560x08,0x38,0xC8,0x00,0xC8,0x38,0x08,0x00,0x00,0x00,0x20,0x3F,0x20,0x00,0x00,0x00,//Y 570x10,0x08,0x08,0x08,0xC8,0x38,0x08,0x00,0x20,0x38,0x26,0x21,0x20,0x20,0x18,0x00,//Z 580x00,0x00,0x00,0xFE,0x02,0x02,0x02,0x00,0x00,0x00,0x00,0x7F,0x40,0x40,0x40,0x00,//[ 590x00,0x0C,0x30,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x06,0x38,0xC0,0x00,//\ 600x00,0x02,0x02,0x02,0xFE,0x00,0x00,0x00,0x00,0x40,0x40,0x40,0x7F,0x00,0x00,0x00,//] 610x00,0x00,0x04,0x02,0x02,0x02,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//^ 620x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,//_ 630x00,0x02,0x02,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//` 640x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x19,0x24,0x22,0x22,0x22,0x3F,0x20,//a 650x08,0xF8,0x00,0x80,0x80,0x00,0x00,0x00,0x00,0x3F,0x11,0x20,0x20,0x11,0x0E,0x00,//b 660x00,0x00,0x00,0x80,0x80,0x80,0x00,0x00,0x00,0x0E,0x11,0x20,0x20,0x20,0x11,0x00,//c 670x00,0x00,0x00,0x80,0x80,0x88,0xF8,0x00,0x00,0x0E,0x11,0x20,0x20,0x10,0x3F,0x20,//d 680x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x1F,0x22,0x22,0x22,0x22,0x13,0x00,//e 690x00,0x80,0x80,0xF0,0x88,0x88,0x88,0x18,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//f 700x00,0x00,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x6B,0x94,0x94,0x94,0x93,0x60,0x00,//g 710x08,0xF8,0x00,0x80,0x80,0x80,0x00,0x00,0x20,0x3F,0x21,0x00,0x00,0x20,0x3F,0x20,//h 720x00,0x80,0x98,0x98,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//i 730x00,0x00,0x00,0x80,0x98,0x98,0x00,0x00,0x00,0xC0,0x80,0x80,0x80,0x7F,0x00,0x00,//j 740x08,0xF8,0x00,0x00,0x80,0x80,0x80,0x00,0x20,0x3F,0x24,0x02,0x2D,0x30,0x20,0x00,//k 750x00,0x08,0x08,0xF8,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//l 760x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x20,0x3F,0x20,0x00,0x3F,0x20,0x00,0x3F,//m 770x80,0x80,0x00,0x80,0x80,0x80,0x00,0x00,0x20,0x3F,0x21,0x00,0x00,0x20,0x3F,0x20,//n 780x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x1F,0x20,0x20,0x20,0x20,0x1F,0x00,//o 790x80,0x80,0x00,0x80,0x80,0x00,0x00,0x00,0x80,0xFF,0xA1,0x20,0x20,0x11,0x0E,0x00,//p 800x00,0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x0E,0x11,0x20,0x20,0xA0,0xFF,0x80,//q 810x80,0x80,0x80,0x00,0x80,0x80,0x80,0x00,0x20,0x20,0x3F,0x21,0x20,0x00,0x01,0x00,//r 820x00,0x00,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x33,0x24,0x24,0x24,0x24,0x19,0x00,//s 830x00,0x80,0x80,0xE0,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x1F,0x20,0x20,0x00,0x00,//t 840x80,0x80,0x00,0x00,0x00,0x80,0x80,0x00,0x00,0x1F,0x20,0x20,0x20,0x10,0x3F,0x20,//u 850x80,0x80,0x80,0x00,0x00,0x80,0x80,0x80,0x00,0x01,0x0E,0x30,0x08,0x06,0x01,0x00,//v 860x80,0x80,0x00,0x80,0x00,0x80,0x80,0x80,0x0F,0x30,0x0C,0x03,0x0C,0x30,0x0F,0x00,//w 870x00,0x80,0x80,0x00,0x80,0x80,0x80,0x00,0x00,0x20,0x31,0x2E,0x0E,0x31,0x20,0x00,//x 880x80,0x80,0x80,0x00,0x00,0x80,0x80,0x80,0x80,0x81,0x8E,0x70,0x18,0x06,0x01,0x00,//y 890x00,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x21,0x30,0x2C,0x22,0x21,0x30,0x00,//z 900x00,0x00,0x00,0x00,0x80,0x7C,0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x3F,0x40,0x40,//{ 910x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,//| 920x00,0x02,0x02,0x7C,0x80,0x00,0x00,0x00,0x00,0x40,0x40,0x3F,0x00,0x00,0x00,0x00,//} 930x00,0x06,0x01,0x01,0x02,0x02,0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//~ 94
};/******************************************************************************
* END OF C++ DECLARATION WRAPPER
******************************************************************************/#ifdef __cplusplus
}
#endif#endif /* __FONT_H */  

4.2 编写测试函数

功能介绍:

1)读取HS3003传感器数据,包括温度和湿度数据

2)转换温湿度数据为ASCLL

3)实时显示温湿度数据到OLED上

 1)数据转换函数

2)显示数据UI

3) 读取温湿度值,并显示数据到UI

4.3 源代码

#include "hal_data.h"
#include "bsp_pwm.h"
#include "bsp_led.h"
#include "bsp_key.h"
#include "bsp_uart.h"
#include "bsp_timer.h"
#include "lcd_drv.h"
#include "hs3003_drv.h"
#include "oled_drv.h"#define OFFSET                     20FSP_CPP_HEADER
void R_BSP_WarmStart(bsp_warm_start_event_t event);
FSP_CPP_FOOTERstatic hs300x_data stru_hs300x;void lcd_test( void )
{uint16_t color_list[6]= {BRRED, BLUE, MAGENTA, RED, YELLOW, GREEN};static int index = 0;LCD_Clear( color_list[index] );index++;R_BSP_SoftwareDelay( 1, BSP_DELAY_UNITS_SECONDS);if( index > 6 )index = 0;
}/*******************************************************************************************************************//*** main() is generated by the RA Configuration editor and is used to generate threads if an RTOS is used.  This function* is called by main() when no RTOS is used.**********************************************************************************************************************/
static void ui_convert( int32_t inputVal, uint8_t *dataBuff )
{uint8_t temp;dataBuff[0] = (uint8_t)(inputVal/1000 + 0x30);dataBuff[1] = (uint8_t)((inputVal%1000)/100 + 0x30);dataBuff[2] = '.';temp = (uint8_t)((inputVal%1000)%100);dataBuff[3] = temp/10 + 0x30 ;dataBuff[4] = temp%10 + 0x30;
}void ui_init( void )
{oled_Clear();oled_SetCharSize( FONT_12 );oled_PrintfString(OFFSET,2,(uint8_t*)"TM(C): ");oled_SetCharSize( FONT_12 );oled_PrintfString(OFFSET,6,(uint8_t*)"HM(%): ");
}void ui_displayTempHumidy( void )
{static uint32_t cnt = 0;uint8_t dataBuff[5];int32_t _outVal;hs300x_read_value( &stru_hs300x );if( (cnt %50) == 0 ) {// tempetureif(stru_hs300x.fetch_bit.mask == HS300X_DATA_VALID){   _outVal = (int32_t)(stru_hs300x.tempval*100);memset((char*)dataBuff, ' ', sizeof(dataBuff));ui_convert(_outVal, dataBuff);oled_SetCharSize( FONT_16 );oled_PrintmutiChar(50+OFFSET,2,(uint8_t*)dataBuff, sizeof(dataBuff));}// humidityif(stru_hs300x.fetch_bit.mask == HS300X_DATA_VALID){   _outVal = (int32_t)(stru_hs300x.humival*100);memset((char*)dataBuff, ' ', sizeof(dataBuff));ui_convert(_outVal, dataBuff);oled_SetCharSize( FONT_16 );oled_PrintmutiChar(50+OFFSET,6,(uint8_t*)dataBuff, sizeof(dataBuff));}}cnt++;
}void bsp_Init( void )
{LED1_OFF;LED2_OFF;LED3_OFF;
}void hal_entry(void)
{/* TODO: add your own code here */timer1_Init();GPT_PWM_Init();bsp_Init();r_sci_uart_basic_init();disp_init();hs300x_init();oled_Init();R_BSP_SoftwareDelay(5, BSP_DELAY_UNITS_SECONDS);ui_init();while(1){if( Key_Scan(KEY1_SW2_PIN) == KEY_ON )  {LED1_TOGGLE; }if( Key_Scan(KEY2_SW3_PIN) == KEY_ON ){LED2_TOGGLE; }ui_displayTempHumidy();}
#if BSP_TZ_SECURE_BUILD/* Enter non-secure code */R_BSP_NonSecureEnter();
#endif
}/*******************************************************************************************************************//*** This function is called at various points during the startup process.  This implementation uses the event that is* called right before main() to set up the pins.** @param[in]  event    Where at in the start up process the code is currently at**********************************************************************************************************************/
void R_BSP_WarmStart (bsp_warm_start_event_t event)
{if (BSP_WARM_START_RESET == event){
#if BSP_FEATURE_FLASH_LP_VERSION != 0/* Enable reading from data flash. */R_FACI_LP->DFLCTL = 1U;/* Would normally have to wait tDSTOP(6us) for data flash recovery. Placing the enable here, before clock and* C runtime initialization, should negate the need for a delay since the initialization will typically take more than 6us. */
#endif}if (BSP_WARM_START_POST_C == event){/* C runtime environment and system clocks are setup. *//* Configure pins. */R_IOPORT_Open(&g_ioport_ctrl, g_ioport.p_cfg);}
}#if BSP_TZ_SECURE_BUILDBSP_CMSE_NONSECURE_ENTRY void template_nonsecure_callable ();/* Trustzone Secure Projects require at least one nonsecure callable function in order to build (Remove this if it is not required to build). */
BSP_CMSE_NONSECURE_ENTRY void template_nonsecure_callable ()
{}
#endif

5 测试

编译代码,并下载到板卡中,UI显示数据如下:

使用手接触到传感器,UI上的数据会有变化

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/web/37938.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

谷粒商城篇章10 -- P262-P291/P295-P310 -- 订单服务(支付)【分布式高级篇七】

目录 1 页面环境搭建 1.1 静态资源上传到nginx 1.2 SwitchHosts增加配置 1.3 网关配置 1.4 订单模块基础配置 1.4.1 引入 thymeleaf 依赖 1.4.2 application.yml配置 1.4.3 bootstrap.properties配置 1.4.4 开启nacos注册发现和远程调用 1.5 修改各个页面的静态资源路…

windows电脑开发ios的p12证书申请流程

很多同学在做ios打包的时候&#xff0c;发现ios打包需要一个p12格式的证书和一个证书profile文件&#xff0c;那么ios开发就一定需要使用mac电脑来申请ios证书吗&#xff1f;其实申请ios证书并不一定需要mac电脑&#xff0c;因为证书是一个通用的技术&#xff0c;使用普通的ssl…

JavaScript将参数传递给事件处理程序

本篇文件我们将实现导航栏中&#xff0c;选中时候&#xff0c;会将您选中的进行高亮显示&#xff1b; ● 首先我们来获取我们想要的HTML元素 const nav document.querySelector(.nav);● 接着我们来写选中的高亮显示 nav.addEventListener(mouseover, function (e) { //鼠…

申请一张含100个域名的证书-免费SSL证书

挑战一下&#xff0c;申请一张包含100个域名的证书 首先&#xff0c;我们访问来此加密网站&#xff0c;进入登录页面&#xff0c;输入我的账号密码。 登录后&#xff0c;咱们就可以开始申请证书&#xff0c;首先说一下&#xff0c;咱账号是SVIP哦&#xff0c;只有SVIP才可以申…

记一次EasyExcel的错误使用导致的频繁FullGC

记一次EasyExcel的错误使用导致的频繁FullGC 一、背景描述二、场景复现三、原因分析四、解决方案五、思考复盘 一、背景描述 繁忙的校招结束了&#xff0c;美好的大学四年也结束了&#xff0c;作者也有10个月没有更新了。拿到心仪的offer之后也开始了苦B的打工生活。 最近接到…

Python海量数据处理脚本大集合:pyWhat

pyWhat&#xff1a;精简海联数据&#xff0c;直达数据弱点要害- 精选真开源&#xff0c;释放新价值。 概览 pyWhat是Github社区上一款比较实用的开源Python脚本工具。它能够快速提取信息中的 IP 地址、邮箱、信用卡、数字货币钱包地址、YouTube 视频等内容。当你遇到了一串莫名…

【PYG】Planetoid中边存储的格式,为什么打印前十条边用edge_index[:, :10]

edge_index 是 PyTorch Geometric 中常用的表示图边的张量。它通常是一个形状为 [2, num_edges] 的二维张量&#xff0c;其中 num_edges 表示图中边的数量。每一列表示一条边&#xff0c;包含两个节点的索引。 实际上这是COO存储格式&#xff0c;官方文档里也有写&#xff0c;…

上位机图像处理和嵌入式模块部署(mcu 项目1:固件编写)

【 声明&#xff1a;版权所有&#xff0c;欢迎转载&#xff0c;请勿用于商业用途。 联系信箱&#xff1a;feixiaoxing 163.com】 说完了上位机的开发&#xff0c;接下来就是固件的开发。前面我们说过&#xff0c;目前使用的开发板是极海apm32f103的开发板。它自身包含了iap示例…

一些迷你型信息系统

只有一个表&#xff0c;比较简单易用&#xff1b; 1 博物馆信息查询系统 信息录入&#xff0c;浏览&#xff0c;添加&#xff0c;更新&#xff0c;删除&#xff1b; 下载&#xff0c; https://download.csdn.net/download/bcbobo21cn/89505217

中国网络安全审查认证和市场监管大数据中心数据合规官CCRC-DCO

关于CCRC-DCO证书的颁发机构&#xff0c;它是由中国网络安全审查认证与市场监管大数据中心&#xff08;简称CCRC&#xff09;负责。 该中心在2006年得到中央机构编制委员会办公室的批准成立&#xff0c;隶属于国家市场监督管理总局&#xff0c;是其直辖的事业单位。 依据《网络…

计算机的错误计算(十八)

摘要 计算机的错误计算&#xff08;四&#xff09;指出一元二次方程的计算精度问题。本节给出其一种解决方案。 计算机的错误计算&#xff08;四&#xff09;与&#xff08;十七&#xff09;分别指出一元二次方程的求解是具有挑战性的难题&#xff0c;其出错原因是因为相减相消…

YOLOv10(7):YOLOv10训练(以训练VOC数据集为例)

YOLOv10&#xff08;1&#xff09;&#xff1a;初探&#xff0c;训练自己的数据_yolov10 训练-CSDN博客 YOLOv10&#xff08;2&#xff09;&#xff1a;网络结构及其检测模型代码部分阅读_yolov10网络结构图-CSDN博客 YOLOv10&#xff08;4&#xff09;&#xff1a;损失&…

【Linux】初识操作系统

一、冯•诺依曼体系结构 在学习操作系统之前&#xff0c;我们先来认识一下冯•诺依曼体系结构&#xff0c;我们常见的计算机&#xff0c;如笔记本。我们不常见的计算机&#xff0c;如服务器&#xff0c;大部分都遵守冯诺依曼体系。 截至目前&#xff0c;我们所认识的计算机&am…

神经网络训练(一):基于残差连接的图片分类网络(ResNet18)

目录 一、简介:二、图片分类网络1.记载训练数据(torch自带的cifa10数据集)2.数据增强3.模型构建4.模型训练三、完整源码及文档一、简介: 基于残差连接的图片分类网络,本网络使用ResNet18作为基础模块,根据cifa10的特点进行改进网络,使用交叉熵损失函数和SGD优化器。本网…

使用pyqt5编写一个七彩时钟

使用pyqt5编写一个七彩时钟 效果代码解析定义 RainbowClockWindow 类初始化用户界面显示时间方法 完整代码 在这篇博客中&#xff0c;我们将使用 PyQt5 创建一个简单的七彩数字时钟。 效果 代码解析 定义 RainbowClockWindow 类 class RainbowClockWindow(QMainWindow):def _…

【TB作品】温湿度监控系统设计,ATMEGA16单片机,Proteus仿真

题2:温湿度监控系统设计 功能要求: 1)开机显示时间(小时、分)、时分可修改; 2)用两个滑动变阻器分别模拟温度传感器(测量范 围0-100度)与湿度传感器(0-100%),通过按键 可以在数码管切换显示当前温度值、湿度值; 3)当温度低于20度时,红灯长亮; 4)当湿度高于70%时,黄灯长亮; 5)当…

安卓实现微信聊天气泡

一搜没一个能用的&#xff0c;我来&#xff1a; 布局文件&#xff1a; <?xml version"1.0" encoding"utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android"http://schemas.android.com/apk/res/android"xml…

Tech Talk:智能电视eMMC存储的五问五答

智能电视作为搭载操作系统的综合影音载体&#xff0c;以稳步扩大的市场规模走入越来越多的家庭&#xff0c;成为人们生活娱乐的重要组成部分。存储部件是智能电视不可或缺的组成部分&#xff0c;用于保存操作系统、应用程序、多媒体文件和用户数据等信息。智能电视使用eMMC作为…

vue3中使用Antv G6渲染树形结构并支持节点增删改

写在前面 在一些管理系统中&#xff0c;会对组织架构、级联数据等做一些管理&#xff0c;你会怎么实现呢&#xff1f;在经过调研很多插件之后决定使用 Antv G6 实现&#xff0c;文档也比较清晰&#xff0c;看看怎么实现吧&#xff0c;先来看看效果图。点击在线体验 实现的功能…

受限玻尔兹曼机浅析

受限玻尔兹曼机&#xff08;Restricted Boltzmann Machine&#xff0c;简称RBM&#xff09;是一种特殊的随机生成神经网络&#xff0c;能够学习并发现数据的复杂规则分布。以下是关于受限玻尔兹曼机算法的详细介绍&#xff1a; ⭐️ 定义与起源 定义&#xff1a; 受限玻尔兹…