hi_void screen_spi_master_init(hi_spi_idx spi_id){
int ret = -1;//screen_ERR;
test_spi_para spi_para; //test_spi_para结构体是spi的基础属性,定义在oled_module/spi_screen.h文件中
void TEST_Menu2(void)
{
extern float Temperature; //Temperature的读取是在不同的文件中,所以想在这个文件中使用就需要将Temperature定义成全局变量,这边引用时加extern
extern float Humidity;
printf("Temperature:%f Humidity:%f \r\n",Temperature,Humidity);
int a = 0;
int b = 0;
int c = 0;
int d = 0;
int e = 0;
int f = 0;
int g = 0;
a = Temperature;
b = a / 10; //整除获取十位上的数据
c = a % 10; //取余获取个位上的数据
d = (Temperature - a) * 10; //Temperature为浮点型数据,a为整形,相减之后就是小数,再乘十,获取到的就是小数后的第一位
e = Humidity;
f = e / 10; //整除获取十位上的数据
g = e % 10; //取余获取各位上的数据
printf("b:%d c:%d d:%d f:%d g:%d\r\n",b,c,d,f,g);
u8 i;
//图形界面的绘制
GUI_DrawLine(0, 10, WIDTH-1, 10,1);
GUI_DrawLine(WIDTH/2-1,11,WIDTH/2-1,HEIGHT-1,1);
GUI_DrawLine(WIDTH/2-1,10+(HEIGHT-10)/2-1,WIDTH-1,10+(HEIGHT-10)/2-1,1);
GUI_ShowString(0,1,"2021-08-1",8,18);
GUI_ShowString(14,HEIGHT-1-10,"Cloudy",8,1);
GUI_ShowString(WIDTH/2-1+2,13,"TEMP",8,1);
GUI_DrawCircle(WIDTH-1-19, 25, 1,2);
GUI_ShowString(WIDTH-1-14,20,"C",16,1);
GUI_ShowString(WIDTH/2-1+2,39,"HUMI",8,1);
GUI_DrawBMP(6,16,51,32, BMP5, 1);
//温湿度的显示
GUI_ShowNum(WIDTH/2-1+9,20,b,1,16,1); //温度的十位数字显示
GUI_ShowNum(WIDTH/2-1+9+8,20,c,1,16,1); //温度的十位数字显示
GUI_ShowString(WIDTH/2-1+9+8+8,20,".",16,1); //小数点显示
GUI_ShowNum(WIDTH/2-1+9+8+16,20,d,1,16,1); //温度的小数显示
GUI_ShowNum(WIDTH/2-1+5,46,f,1,16,1); //湿度的十位显示
GUI_ShowNum(WIDTH/2-1+5+8,46,g,1,16,1); //湿度的个位显示
GUI_ShowString(WIDTH/2-1+5+8+8,46,"/rh",16,1); //湿度的单位显示
sleep(2);
}