首页
hejiahua007
取消

STM32F103——气体质量

代码 #include "adc.h" /******************************************************************************* *函数的原型:void ADC_Pin_Init(void) *函数的功能:GPIO初始化 *函数的参数:None *函数返回值:None *函数的说明:PA0 ADC1_IN0 模拟输入 ...

STM32F103——光照

代码 #include "delay.h" #include "bh1750.h" typedef unsigned char BYTE; void Single_Write_BH1750(uchar REG_Address) { IIC_Start(); //起始信号 IIC_Send_Byte(BHAddWrite); //发送设...

STM32F103——esp8266

代码 #include "esp8266.h" #include "delay.h" #include <stdarg.h> struct STRUCT_USART_Fram ESP8266_Fram_Record_Struct = { 0 }; //定义了一个数据帧结构体 //void ESP8266_Init(u32 bound) //{ // GPIO_Ini...

STM32F103——串口

代码 #include "stm32f10x.h" // Device header #include <stdio.h> #include <stdarg.h> uint8_t Usart1_RxData; //定义串口接收的数据变量 uint8_t USART1_RxFlag; //定义串口接收的标志位变量 /** *...

树莓派——天气预报

天气预报 开启天气预报定时器,到了那个时间点就获取往后三天的天气 import requests import time import speaking from clock import Alarm_add,Alarm_del api_key = "" city_name = "麻章" # 通过城市查询接口获取城市ID city_url = f"https://geoapi.qweat...

树莓派——解决时间问题,编译慢(搁置)

前言 昨天算是将语音合成的问题解决了,但在树莓派上面语音合成的速度极慢,快则1分钟,慢则2分钟以上。 计算每个模块需要的时间 import time start_time = time.time() # 记录开始时间 ... ... ... end_time = time.time() # 记录结束时间 elapsed_time = end_time - start_time p...

树莓派——音乐播放

音乐播放 播放某个文件夹下面的音乐 import pygame def play_audio(audio_file_name): # Initialize pygame pygame.init() # Set the audio file pygame.mixer.music.load(audio_file_name) # Play the audi...

树莓派——tcp_server

tcp服务器 想法:主进程中fock一个子进程用来搭建tcp的服务器端,不断的连接tcp客户端,接收和转发处理存储数据,子进程与主进程间使用管道进行通信。 import socket import threading from multiprocessing import Pipe import sqlite1 import select HOST = '192.168.**.**' PO...

树莓派——sqlite3

数据库sqlite3 以创建数据库(2023-12-28.db),当前时间13点,精确到小时(table_13),创建。 import sqlite3 import os from datetime import datetime # 指定数据库文件夹路径 db_dir = "/home/pi/Desktop/sleep/file/sqlite_file/" def create_t...

树莓派——每日一言

每日一言 import requests import speaking from clock import Alarm_add,Alarm_del url = "https://v1.hitokoto.cn/?c=a&c=c&c=e&c=f&c=h&c=i&c=k" def yiyan(): response = requests.g...