找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 5584|回复: 4
收起左侧

STM32f103通过WiFi连接阿里云的简单智能家居系统程序

[复制链接]
ID:677706 发表于 2019-12-30 20:11 | 显示全部楼层 |阅读模式
WiFi模块为esp8266
可以通过连接阿里云,控制RGB,电机,步进电机等。

注意:WiFi名和密码需修改成自己的。连接阿里云的相关参数要修改成自己的。

单片机源程序如下:
  1. #include "stm32f10x.h"
  2. #include "led.h"
  3. #include "delay.h"
  4. #include "motor.h"
  5. #include "uart.h"
  6. #include "stdio.h"
  7. #include "string.h"
  8. #include "makedata.h"
  9. #include "rgbled.h"
  10. #include "dht11.h"
  11. #include "wifi.h"
  12. #include "MQTT.h"
  13. #include "stepmotor.h"
  14. #include "oled.h"
  15. int main(void)
  16. {
  17.         uint8_t buf[50]={0};
  18.        
  19.        
  20. //        TYPE_DATA value={0};
  21. //        TYPE_DHT11 dht11={0};
  22.         uint8_t ret;
  23.        
  24.         LedInit( );//LED初始化
  25.         MotorInit( );
  26.         RGBPinInit( );
  27.         uart1_init(72,115200);
  28.         Uart2Init(115200);
  29.         DHT11PinInit( );
  30.         StepMotorPinInit( );
  31.         OLEDInit( );
  32.         Display( );
  33.        
  34.         while(1)
  35.         {
  36.                
  37.                
  38.                
  39.         }
  40. }
复制代码

所有资料51hei提供下载:
阿里云.7z (84.21 KB, 下载次数: 156)



回复

使用道具 举报

ID:1 发表于 2019-12-31 00:43 | 显示全部楼层
本帖需要重新编辑补全电路原理图,源码,详细说明与图片即可获得100+黑币(帖子下方有编辑按钮)
回复

使用道具 举报

ID:359938 发表于 2019-12-31 15:57 | 显示全部楼层
已经下载来编译过了,在main里面都没有对esp8266的初始化,还有mqtt的连接步骤都没有,代码中使用的是库函数,只能下来看看,其他没什么多大意义。
回复

使用道具 举报

ID:359938 发表于 2019-12-31 16:01 | 显示全部楼层
代码已经下载来看了,主函数里面对esp8266的操作都没有,感觉没多大意义
回复

使用道具 举报

ID:374948 发表于 2020-1-7 10:47 | 显示全部楼层
没什么多大意义,内部东西,学习不了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

快速回复 返回顶部 返回列表