arduino

ESP8266发消息到微信,超阈值报警,消息提醒等

北慕城南 提交于 2021-02-11 22:02:41
材料准备 ESP8266一块 手机一块 第一 下载ESP8266示例(arduino ide 编程开发) 下载地址: 点击下载 本demo 是利用arduino IDE开发,关于arduino IDE 的ESP8266环境配置可参考:环境配置: 点击跳转 需要修改的地方: /******************************************************************************/ #define DEFAULT_STASSID "HTC" //WIFI名称 #define DEFAULT_STAPSW "abc123456" //WIFI密码 String uid = "f49412ea7657d8f738cafe29bc245c14"; // 用户私钥,巴法云控制台获取 String type = "1"; // 1表示是预警消息,默认即可 String device = "人体红外传感器设备"; // 设备名称,可随意更改 String msg = "检测到班主任已站在窗户边,立即放下手机假装学习"; //发送的消息,可随意更改 String msg2 = "小样"; //消息备注,可为空,可随意更改 int delaytime = 0; //为了防止被设备“骚扰”,可设置贤者时间,单位是秒,如果设置了该值

Python / PySerial / Arduino Reading serial data and later writing this exact serial data to the txt file

无人久伴 提交于 2021-02-11 16:21:20
问题 I am making a new post regarding this case because I was misunderstood in the first one... I have a code that reads the serial data from the Arduino and when some specific digits are pressed on the keyboard it writes these digits to the Arduino. This exact code works perfectly when I run it , it reads the serial data and I am able to write data to the Arduino. I use threading and PySerial library to achieve this. from pynput import keyboard import threading import serial import sys ser = None

Python / PySerial / Arduino Reading serial data and later writing this exact serial data to the txt file

老子叫甜甜 提交于 2021-02-11 16:19:52
问题 I am making a new post regarding this case because I was misunderstood in the first one... I have a code that reads the serial data from the Arduino and when some specific digits are pressed on the keyboard it writes these digits to the Arduino. This exact code works perfectly when I run it , it reads the serial data and I am able to write data to the Arduino. I use threading and PySerial library to achieve this. from pynput import keyboard import threading import serial import sys ser = None

Arduino 基于 ESP8266 配置WIFI模块

廉价感情. 提交于 2021-02-11 16:00:40
Arduino 基于 ESP8266 配置WIFI模块 使用ESP8266作为服务器,使用浏览器访问该服务器,从而控制LED灯 选择 【文件】->【示例】->【ESP8266WIFI】->【WiFiWebServer】 用Arduino新建一个文件,将刚打开的的WIFIWebServer的内容复制过去 修改 ssid 和 password 为自家路由器的名称以及密码 将程序上传到 ESP8266 开发板中 最后就可以通过网站 [ip]/gpio/1 或 [ip]/gpio/0 控制灯开关 # http://192.168.0.57/gpio/1 # ip 地址在序列库中可以看到 附上代码 /* * This sketch demonstrates how to set up a simple HTTP-like server. * The server will set a GPIO pin depending on the request * http://server_ip/gpio/0 will set the GPIO2 low, * http://server_ip/gpio/1 will set the GPIO2 high * server_ip is the IP address of the ESP8266 module, will be * printed to

Arduino使用ESP8266模块联网

自作多情 提交于 2021-02-11 15:27:46
ESP8266模块准备 1. 透传程序烧写 2. Arduino与ESP8266接线 Arduino模块程序 测试 总结 上一篇文章已经介绍了 利用 ArduinoIDE开发ESP8266模块,这篇文章介绍一下arduino怎么通过ESP8266模块联网 ESP8266模块准备 1. 透传程序烧写 以下程序的主要功能是: 1. 通电自动连接指定wifi 2. 通过tcp协议连接指定服务器的指定端口 3. tcp连接断线重连 4. 10s自动发送心跳包 #include <ESP8266WiFi.h> const char *ssid = "你的wifi" ; const char *password = "wifi密码" ; WiFiClient client ; const char *host = "服务器" ; const int port = 0 ; void setupWifi() { delay( 10 ); Serial.println(); Serial.print( "Connecting to " ); Serial.println(ssid); WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) { delay( 500 ); Serial.print( "." ); }

Switching a bulb ON and OFF using toggle switch in Arduino

∥☆過路亽.° 提交于 2021-02-11 14:21:39
问题 Kindly help me in the Arduino code as I am new in this field. I have Arduino code that turns the light in bulb ON and OFF using toggle switch. It is successfully running and giving output. The following is the code: int buttonPinBulb = 11; int relay1 = 10; void setup() { pinMode(buttonPinBulb, INPUT_PULLUP); pinMode(relay1, OUTPUT); Serial.begin(115200); } void loop() { // put your main code here, to run repeatedly: int buttonBulb = digitalRead(buttonPinBulb); if(buttonBulb == HIGH){

How to add a live (updating) graph to my PyQt5 Window using Serial?

我们两清 提交于 2021-02-11 12:34:52
问题 I am writting a program that's supposed to receive 4 random values from my Arduino every second and create an updating bar chart with them. I then want to create a PyQt5 Window to show that bar chart. I was sucessful at reading the values coming from my Arduino and using them to create the bar chart. However, since I'm a beginner when it comes to GUI/Arduino, I have no clue how to add that bar chart to my PyQt Window. I'd appreciate if you could help me with that. Here's my Arduino code: void

How to add a live (updating) graph to my PyQt5 Window using Serial?

ぃ、小莉子 提交于 2021-02-11 12:34:07
问题 I am writting a program that's supposed to receive 4 random values from my Arduino every second and create an updating bar chart with them. I then want to create a PyQt5 Window to show that bar chart. I was sucessful at reading the values coming from my Arduino and using them to create the bar chart. However, since I'm a beginner when it comes to GUI/Arduino, I have no clue how to add that bar chart to my PyQt Window. I'd appreciate if you could help me with that. Here's my Arduino code: void

Arduino How can I use char instead of String (for better memory usage)

偶尔善良 提交于 2021-02-11 12:29:21
问题 I have read thousand times that String library is not the best solution for code and memory optimization. So I need to use char instead of String. I have several functions that return String where I use it for store in file (sd card) or post it to web as param. So in the following sketch, how can i change it to work with char. I know how to save to sd file or post to webserver. I need only help for change the String to char. #include <ThreeWire.h> #include <RtcDS1302.h> ThreeWire myWire(7,8,6

What is the cause of the errors “'timer0_pin_port'” and “'_vector_13'”?

偶尔善良 提交于 2021-02-11 12:07:47
问题 #include "IRremote.h" int receiver = 11; IRrecv irReceiver(receiver); decode_results results; void setup() { // put your setup code here, to run once: pinMode(buttonPinA, INPUT_PULLUP); pinMode(buttonPinB, INPUT_PULLUP); pinMode(buttonPinC, INPUT_PULLUP); pinMode(buttonPinD, INPUT_PULLUP); irReceiver.enableIRIn(); } The error message is: Tone.cpp.o (symbol from plugin): In function `timer0_pin_port': (.text+0x0): multiple definition of `__vector_13' libraries\IRremote\IRremote.cpp.o (symbol