1 Star 0 Fork 0

hznupeter / weatherStation

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
weatherStation.press 1.27 KB
一键复制 编辑 原始数据 按行查看 历史
hznupeter 提交于 2021-06-08 20:48 . 更新
/*
显示气压模块
*/
#define BLYNK_PRINT Serial
#define CSPin 12
#include <Wire.h>
#include <WiFiManager.h>
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Max72xxPanel.h>
#include <BlynkSimpleEsp8266.h>
#include "Tiny5pt7A.h"
float Temp, Hum, Pressure;
char press_auth[] = "QwyARDcUsln_hNKOkMPLzkSHjvhEFmE8";
Max72xxPanel myMatrix = Max72xxPanel(CSPin, 4, 1);
BLYNK_WRITE(V0) {
Pressure = param.asFloat();
myMatrix.fillScreen(0);
myMatrix.setFont(&Tiny5pt7A);
myMatrix.setCursor(0, 22);
Serial.println(int(Pressure / 100));
myMatrix.print(int(Pressure / 100));
myMatrix.write();
Serial.println(Pressure);
}
void setup() {
Serial.begin(9600);
WiFiManager wifiManager;
myMatrix.setIntensity(15);
myMatrix.fillScreen(LOW);
for (int i = 0; i < 4; i++) {//设置显示方向
myMatrix.setRotation(i, 1);//设置点阵屏显示方向(红色)
//myMatrix.setPosition(i, i, 0);//设置点阵屏位置,不同点阵屏,不同方向,可能要调整
}
myMatrix.setCursor(2, 0);
myMatrix.print("Press");
myMatrix.write();
if (!wifiManager.autoConnect("Press")) {
Serial.println("failed to connect and hit timeout");
delay(3000);
ESP.reset();
delay(5000);
}
Serial.println("local ip");
Serial.println(WiFi.localIP());
Blynk.config(press_auth, "blynk.mixly.org", 8080);
}
void loop() {
Blynk.run();
}
1
https://gitee.com/hznupeter/weatherStation.git
git@gitee.com:hznupeter/weatherStation.git
hznupeter
weatherStation
weatherStation
main

搜索帮助