问题标签 [blynk]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
498 浏览

c - Blynk_Write 参数进入和中断循环

我是 Arduino 和 blynk 的新手。我正在使用 blynk 作为我的移动应用程序开发自动布料生产线,并且我得到了部分工作。我正在使用虚拟引脚进入运行良好的循环。但是在按下同一个按钮时,它应该结束当前状态下没有发生的循环。

似乎我缺少一些简单的东西。有什么想法吗 ?

0 投票
0 回答
206 浏览

node.js - pigpio 安装脚本是否损坏?

我用树莓派做门锁,然后眨眼。当我尝试在目录中执行 sudo npm install 时,我得到这个:“npm ERR!在 pigpio@0.4.0 安装脚本失败。npm ERR!这可能不是 npm 的问题。上面可能有额外的日志输出。” 顺便说一句,我正在使用这个: https ://github.com/HackerShackOfficial/Smartphone-Doorlock

我也尝试在没有 pigpio 的情况下继续,但似乎模块 pigpio 是必要的。

正如 Jason 所问(谢谢:D),这里是完整代码:https 0 info it worked if it ends with ok 1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'install' ] 2 info using npm@6.10.2 3 info using node@v10.0.0 4 verbose npm-session bcd5a4f2650522e3 5 silly install runPreinstallTopLevelLifecycles 6 silly preinstall test-blynk@1.0.0 7 info lifecycle test-blynk@1.0.0~preinstall: test-blynk@1.0.0 8 silly install loadCurrentTree 9 silly install readLocalPackageData 10 timing stage:loadCurrentTree Completed in 166ms 11 silly install loadIdealTree 12 silly install cloneCurrentTreeToIdealTree 13 timing stage:loadIdealTree:cloneCurrentTree Completed in 5ms 14 silly install loadShrinkwrap 15 timing stage:loadIdealTree:loadShrinkwrap Completed in 163ms 16 silly install loadAllDepsIntoIdealTree 17 timing stage:loadIdealTree:loadAllDepsIntoIdealTree Completed in 201ms 18 timing stage:loadIdealTree Completed in 427ms 19 silly currentTree test-blynk@1.0.0 20 silly idealTree test-blynk@1.0.0 20 silly idealTree ├── bindings@1.3.1 20 silly idealTree ├── blynk-library@0.5.1 20 silly idealTree ├── epoll@1.0.2 20 silly idealTree ├── nan@2.8.0 20 silly idealTree ├── onoff@1.2.0 20 silly idealTree └─┬ pigpio@0.4.0 20 silly idealTree ├── bindings@1.2.1 20 silly idealTree └── nan@2.4.0 21 silly install generateActionsToTake 22 timing stage:generateActionsToTake Completed in 98ms 23 silly diffTrees action count 8 24 silly diffTrees add bindings@1.3.1 25 silly diffTrees add nan@2.8.0 26 silly diffTrees add epoll@1.0.2 27 silly diffTrees add bindings@1.2.1 28 silly diffTrees add nan@2.4.0 29 silly diffTrees add blynk-library@0.5.1 30 silly diffTrees add onoff@1.2.0 31 silly diffTrees add pigpio@0.4.0 32 silly decomposeActions action count 64 33 silly decomposeActions fetch bindings@1.3.1 34 silly decomposeActions extract bindings@1.3.1 35 silly decomposeActions preinstall bindings@1.3.1 36 silly decomposeActions build bindings@1.3.1 37 silly decomposeActions install bindings@1.3.1 38 silly decomposeActions postinstall bindings@1.3.1 39 silly decomposeActions finalize bindings@1.3.1 40 silly decomposeActions refresh-package-json bindings@1.3.1 41 silly decomposeActions fetch nan@2.8.0 42 silly decomposeActions extract nan@2.8.0 43 silly decomposeActions preinstall nan@2.8.0 44 silly decomposeActions build nan@2.8.0 45 silly decomposeActions install nan@2.8.0 46 silly decomposeActions postinstall nan@2.8.0 47 silly decomposeActions finalize nan@2.8.0 48 silly decomposeActions refresh-package-json nan@2.8.0 49 silly decomposeActions fetch epoll@1.0.2 50 silly decomposeActions extract epoll@1.0.2 51 silly decomposeActions preinstall epoll@1.0.2 52 silly decomposeActions build epoll@1.0.2 53 silly decomposeActions install epoll@1.0.2 54 silly decomposeActions postinstall epoll@1.0.2 55 silly decomposeActions finalize epoll@1.0.2 56 silly decomposeActions refresh-package-json epoll@1.0.2 57 silly decomposeActions fetch bindings@1.2.1 58 silly decomposeActions extract bindings@1.2.1 59 silly decomposeActions preinstall bindings@1.2.1 60 silly decomposeActions build bindings@1.2.1 61 silly decomposeActions install bindings@1.2.1 62 silly decomposeActions postinstall bindings@1.2.1 63 silly decomposeActions finalize bindings@1.2.1 64 silly decomposeActions refresh-package-json bindings@1.2.1 65 silly decomposeActions fetch nan@2.4.0 66 silly decomposeActions extract nan@2.4.0 67 silly decomposeActions preinstall nan@2.4.0 68 silly decomposeActions build nan@2.4.0 69 silly decomposeActions install nan@2.4.0 70 silly decomposeActions postinstall nan@2.4.0 71 silly decomposeActions finalize nan@2.4.0 72 silly decomposeActions refresh-package-json nan@2.4.0 73 silly decomposeActions fetch blynk-library@0.5.1 74 silly decomposeActions extract blynk-library@0.5.1 75 silly decomposeActions preinstall blynk-library@0.5.1 76 silly decomposeActions build blynk-library@0.5.1 77 silly decomposeActions install blynk-library@0.5.1 78 silly decomposeActions postinstall blynk-library@0.5.1 79 silly decomposeActions finalize blynk-library@0.5.1 80 silly decomposeActions refresh-package-json blynk-library@0.5.1 81 silly decomposeActions fetch onoff@1.2.0 82 silly decomposeActions extract onoff@1.2.0 83 silly decomposeActions preinstall onoff@1.2.0 84 silly decomposeActions build onoff@1.2.0 85 silly decomposeActions install onoff@1.2.0 86 silly decomposeActions postinstall onoff@1.2.0 87 silly decomposeActions finalize onoff@1.2.0 88 silly decomposeActions refresh-package-json onoff@1.2.0 89 silly decomposeActions fetch pigpio@0.4.0 90 silly decomposeActions extract pigpio@0.4.0 91 silly decomposeActions preinstall pigpio@0.4.0 92 silly decomposeActions build pigpio@0.4.0 93 silly decomposeActions install pigpio@0.4.0 94 silly decomposeActions postinstall pigpio@0.4.0 95 silly decomposeActions finalize pigpio@0.4.0 96 silly decomposeActions refresh-package-json pigpio@0.4.0 97 silly install executeActions 98 silly doSerial global-install 64 99 verbose correctMkdir /home/pi/.npm/_locks correctMkdir not in flight; initializing 100 verbose lock using /home/pi/.npm/_locks/staging-654f2c7af40241aa.lock for /home/pi/Smartphone-Doorlock/node_modules/.staging 101 silly doParallel extract 8 102 silly extract bindings@1.3.1 103 silly extract nan@2.8.0 104 silly extract epoll@1.0.2 105 silly extract bindings@1.2.1 106 silly extract nan@2.4.0 107 silly extract blynk-library@0.5.1 108 silly extract onoff@1.2.0 109 silly extract pigpio@0.4.0 110 silly tarball trying bindings@1.3.1 by hash: sha512-i47mqjF9UbjxJhxGf+pZ6kSxrnI3wBLlnGI2ArWJ4r0VrvDS7ZYXkprq/pLaBWYq4GM0r4zdHY+NNRqEMU7uew== 111 silly tarball trying nan@2.8.0 by hash: sha1-7XFfP+neArV6XmJS2QqWZ14fCFo= 112 silly tarball trying epoll@1.0.2 by hash: sha512-3t2crZPej4v60YYvXE/pgJ62D4RZBd/UsEXsHd+H3xtDre0vO8aV9O+0ThIPlfZtHJ4vMPhz55fYK1j37rX9Ng== 113 silly tarball trying bindings@1.2.1 by hash: sha1-FK1hE4EtLTfXLme0ystLtyZQXxE= 114 silly tarball trying nan@2.4.0 by hash: sha1-+zxZ1F/k7/4hXwuJD4rfbrMtIjI= 115 silly tarball trying blynk-library@0.5.1 by hash: sha512-YR5aNsNF0Atny/VGjz46kluImM8zPidLbwaVj8Peuxywro7VKi4QvSW2u5KiwhtsqqSWNHtdUXJhVbOjfchDiw== 116 silly tarball trying onoff@1.2.0 by hash: sha512-o41qBIIs6agXRjryGBIJpq1xour69VDBfROf3IX+wiwutIowPZDcjTRCqFo+HYleiQngO1wfNqHWpjm0l0oYwQ== 117 silly tarball trying pigpio@0.4.0 by hash: sha1-EfvLRReYDKG4JS6+Iffbb36mVbk= 118 silly tarball no local data for bindings@1.3.1. Extracting by manifest. 119 silly tarball no local data for nan@2.8.0. Extracting by manifest. 120 silly tarball no local data for epoll@1.0.2. Extracting by manifest. 121 silly tarball no local data for blynk-library@0.5.1. Extracting by manifest. 122 silly tarball no local data for onoff@1.2.0. Extracting by manifest. 123 timing audit submit Completed in 2515ms 124 http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/audits/quick 2519ms 125 timing audit body Completed in 55ms 126 silly extract bindings@1.2.1 extracted to /home/pi/Smartphone-Doorlock/node_modules/.staging/bindings-f29b19a0 (2134ms) 127 http fetch GET 200 https://registry.npmjs.org/bindings/-/bindings-1.3.1.tgz 2038ms 128 http fetch GET 200 https://registry.npmjs.org/epoll/-/epoll-1.0.2.tgz 1998ms 129 http fetch GET 200 https://registry.npmjs.org/blynk-library/-/blynk-library-0.5.1.tgz 1978ms 130 silly extract bindings@1.3.1 extracted to /home/pi/Smartphone-Doorlock/node_modules/.staging/bindings-6d32fc31 (2493ms) 131 http fetch GET 200 https://registry.npmjs.org/nan/-/nan-2.8.0.tgz 2671ms 132 silly extract blynk-library@0.5.1 extracted to /home/pi/Smartphone-Doorlock/node_modules/.staging/blynk-library-d777a2f0 (3134ms) 133 silly extract epoll@1.0.2 extracted to /home/pi/Smartphone-Doorlock/node_modules/.staging/epoll-66440cc3 (3510ms) 134 silly extract nan@2.4.0 extracted to /home/pi/Smartphone-Doorlock/node_modules/.staging/nan-9be4f48a (4150ms) 135 http fetch GET 200 https://registry.npmjs.org/onoff/-/onoff-1.2.0.tgz 3872ms 136 silly extract nan@2.8.0 extracted to /home/pi/Smartphone-Doorlock/node_modules/.staging/nan-5312de16 (4547ms) 137 silly extract pigpio@0.4.0 extracted to /home/pi/Smartphone-Doorlock/node_modules/.staging/pigpio-3c408b80 (4550ms) 138 silly extract onoff@1.2.0 extracted to /home/pi/Smartphone-Doorlock/node_modules/.staging/onoff-5e79b3e7 (4649ms) 139 timing action:extract Completed in 4725ms 140 silly doReverseSerial unbuild 64 141 silly doSerial remove 64 142 silly doSerial move 64 143 silly doSerial finalize 64 144 silly finalize /home/pi/Smartphone-Doorlock/node_modules/bindings 145 silly finalize /home/pi/Smartphone-Doorlock/node_modules/nan 146 silly finalize /home/pi/Smartphone-Doorlock/node_modules/epoll 147 silly finalize /home/pi/Smartphone-Doorlock/node_modules/pigpio/node_modules/bindings 148 silly finalize /home/pi/Smartphone-Doorlock/node_modules/pigpio/node_modules/nan 149 silly finalize /home/pi/Smartphone-Doorlock/node_modules/blynk-library 150 silly finalize /home/pi/Smartphone-Doorlock/node_modules/onoff 151 silly finalize /home/pi/Smartphone-Doorlock/node_modules/pigpio 152 timing action:finalize Completed in 244ms 153 silly doParallel refresh-package-json 8 154 silly refresh-package-json /home/pi/Smartphone-Doorlock/node_modules/bindings 155 silly refresh-package-json /home/pi/Smartphone-Doorlock/node_modules/nan 156 silly refresh-package-json /home/pi/Smartphone-Doorlock/node_modules/epoll 157 silly refresh-package-json /home/pi/Smartphone-Doorlock/node_modules/pigpio/node_modules/bindings 158 silly refresh-package-json /home/pi/Smartphone-Doorlock/node_modules/pigpio/node_modules/nan 159 silly refresh-package-json /home/pi/Smartphone-Doorlock/node_modules/blynk-library 160 silly refresh-package-json /home/pi/Smartphone-Doorlock/node_modules/onoff 161 silly refresh-package-json /home/pi/Smartphone-Doorlock/node_modules/pigpio 162 timing action:refresh-package-json Completed in 423ms 163 silly doParallel preinstall 8 164 silly preinstall bindings@1.3.1 165 info lifecycle bindings@1.3.1~preinstall: bindings@1.3.1 166 silly preinstall nan@2.8.0 167 info lifecycle nan@2.8.0~preinstall: nan@2.8.0 168 silly preinstall epoll@1.0.2 169 info lifecycle epoll@1.0.2~preinstall: epoll@1.0.2 170 silly preinstall bindings@1.2.1 171 info lifecycle bindings@1.2.1~preinstall: bindings@1.2.1 172 silly preinstall nan@2.4.0 173 info lifecycle nan@2.4.0~preinstall: nan@2.4.0 174 silly preinstall blynk-library@0.5.1 175 info lifecycle blynk-library@0.5.1~preinstall: blynk-library@0.5.1 176 silly preinstall onoff@1.2.0 177 info lifecycle onoff@1.2.0~preinstall: onoff@1.2.0 178 silly preinstall pigpio@0.4.0 179 info lifecycle pigpio@0.4.0~preinstall: pigpio@0.4.0 180 timing action:preinstall Completed in 15ms 181 silly doSerial build 64 182 silly build bindings@1.3.1 183 info linkStuff bindings@1.3.1 184 silly linkStuff bindings@1.3.1 has /home/pi/Smartphone-Doorlock/node_modules as its parent node_modules 185 silly build nan@2.8.0 186 info linkStuff nan@2.8.0 187 silly linkStuff nan@2.8.0 has /home/pi/Smartphone-Doorlock/node_modules as its parent node_modules 188 silly build epoll@1.0.2 189 info linkStuff epoll@1.0.2 190 silly linkStuff epoll@1.0.2 has /home/pi/Smartphone-Doorlock/node_modules as its parent node_modules 191 silly build bindings@1.2.1 192 info linkStuff bindings@1.2.1 193 silly linkStuff bindings@1.2.1 has /home/pi/Smartphone-Doorlock/node_modules/pigpio/node_modules as its parent node_modules 194 silly build nan@2.4.0 195 info linkStuff nan@2.4.0 196 silly linkStuff nan@2.4.0 has /home/pi/Smartphone-Doorlock/node_modules/pigpio/node_modules as its parent node_modules 197 silly build blynk-library@0.5.1 198 info linkStuff blynk-library@0.5.1 199 silly linkStuff blynk-library@0.5.1 has /home/pi/Smartphone-Doorlock/node_modules as its parent node_modules 200 verbose linkBins [ { 'blynk-client': 'bin/blynk-client.js', 200 verbose linkBins 'blynk-ctrl': 'bin/blynk-ctrl.js' }, 200 verbose linkBins '/home/pi/Smartphone-Doorlock/node_modules/.bin', 200 verbose linkBins false ] 201 silly build onoff@1.2.0 202 info linkStuff onoff@1.2.0 203 silly linkStuff onoff@1.2.0 has /home/pi/Smartphone-Doorlock/node_modules as its parent node_modules 204 silly build pigpio@0.4.0 205 info linkStuff pigpio@0.4.0 206 silly linkStuff pigpio@0.4.0 has /home/pi/Smartphone-Doorlock/node_modules as its parent node_modules 207 timing action:build Completed in 88ms 208 silly doSerial global-link 64 209 silly doParallel update-linked 0 210 silly doSerial install 64 211 silly install bindings@1.3.1 212 info lifecycle bindings@1.3.1~install: bindings@1.3.1 213 silly install nan@2.8.0 214 info lifecycle nan@2.8.0~install: nan@2.8.0 215 silly install epoll@1.0.2 216 info lifecycle epoll@1.0.2~install: epoll@1.0.2 217 verbose lifecycle epoll@1.0.2~install: unsafe-perm in lifecycle true 218 verbose lifecycle epoll@1.0.2~install: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/pi/Smartphone-Doorlock/node_modules/epoll/node_modules/.bin:/home/pi/Smartphone-Doorlock/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games 219 verbose lifecycle epoll@1.0.2~install: CWD: /home/pi/Smartphone-Doorlock/node_modules/epoll 220 silly lifecycle epoll@1.0.2~install: Args: [ '-c', 'node-gyp rebuild' ] 221 silly lifecycle epoll@1.0.2~install: Returned: code: 0 signal: null 222 silly install bindings@1.2.1 223 info lifecycle bindings@1.2.1~install: bindings@1.2.1 224 silly install nan@2.4.0 225 info lifecycle nan@2.4.0~install: nan@2.4.0 226 silly install blynk-library@0.5.1 227 info lifecycle blynk-library@0.5.1~install: blynk-library@0.5.1 228 silly install onoff@1.2.0 229 info lifecycle onoff@1.2.0~install: onoff@1.2.0 230 silly install pigpio@0.4.0 231 info lifecycle pigpio@0.4.0~install: pigpio@0.4.0 232 verbose lifecycle pigpio@0.4.0~install: unsafe-perm in lifecycle true 233 verbose lifecycle pigpio@0.4.0~install: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/pi/Smartphone-Doorlock/node_modules/pigpio/node_modules/.bin:/home/pi/Smartphone-Doorlock/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games 234 verbose lifecycle pigpio@0.4.0~install: CWD: /home/pi/Smartphone-Doorlock/node_modules/pigpio 235 silly lifecycle pigpio@0.4.0~install: Args: [ '-c', 'node-gyp rebuild' ] 236 silly lifecycle pigpio@0.4.0~install: Returned: code: 1 signal: null 237 info lifecycle pigpio@0.4.0~install: Failed to exec install script 238 timing action:install Completed in 36781ms 239 verbose unlock done using /home/pi/.npm/_locks/staging-654f2c7af40241aa.lock for /home/pi/Smartphone-Doorlock/node_modules/.staging 240 timing stage:rollbackFailedOptional Completed in 332ms 241 timing stage:runTopLevelLifecycles Completed in 44552ms 242 silly saveTree test-blynk@1.0.0 242 silly saveTree ├── blynk-library@0.5.1 242 silly saveTree ├─┬ onoff@1.2.0 242 silly saveTree │ └─┬ epoll@1.0.2 242 silly saveTree │ ├── bindings@1.3.1 242 silly saveTree │ └── nan@2.8.0 242 silly saveTree └─┬ pigpio@0.4.0 242 silly saveTree ├── bindings@1.2.1 242 silly saveTree └── nan@2.4.0 243 warn test-blynk@1.0.0 No repository field. 244 verbose stack Error: pigpio@0.4.0 install: : //pastebin.com/3YHyvp3e node-gyp rebuild 244 verbose stack Exit status 1 244 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:326:16) 244 verbose stack at EventEmitter.emit (events.js:182:13) 244 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14) 244 verbose stack at ChildProcess.emit (events.js:182:13) 244 verbose stack at maybeClose (internal/child_process.js:947:16) 244 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:236:5) 245 verbose pkgid pigpio@0.4.0 246 verbose cwd /home/pi/Smartphone-Doorlock 247 verbose Linux 4.19.58-v7+ 248 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" 249 verbose node v10.0.0 250 verbose npm v6.10.2 251 error code ELIFECYCLE 252 error errno 1 253 error pigpio@0.4.0 install:node-gyp rebuild 253 error Exit status 1 254 error Failed at the pigpio@0.4.0 install script. 254 error This is probably not a problem with npm. There is likely additional logging output above. 255 verbose exit [ 1, true ]

0 投票
1 回答
36 浏览

c++ - 如何将“使用 NodeMCU 的 Blynk 代码”转换为“使用 ArduinoUno 的 Blynk 代码”

我会寻求你的帮助。下面的代码是在 NodeMCU 上运行的源代码的一部分。

我知道 NodeMCU 的引脚 D6 就像 GPIO12。D1、D2 与 GPIO5 和 GPIO4 进行比较。但 NodeMCU 就是这种情况。那么当这个图配置为ArduinoUNO时,是否需要更改#define行中的数字?如果是这样,我们如何改变它?我需要答案。

谢谢你。我学到了很多东西。

0 投票
1 回答
1225 浏览

python - 如何修复“IndexError:索引超出范围”

我用 Blynk 构建了一个简单的应用程序。不幸的是,我经常收到错误:

即使我取出硬件上的所有代码并最终得到以下代码,也会出现错误:

我不知道究竟是什么导致了错误,但是,我注意到发生了错误

  • 当 Blynk 应用程序移至后台时
  • 当手机屏幕变黑时
  • 通过右上角的停止按钮在 Blynk 应用程序中正常断开连接时不会发生错误,如果重新连接也不会发生
0 投票
1 回答
199 浏览

bluetooth - 与 Arduino 的 GPS 通信

我一直在积极尝试将“Ultimate Breakout GPS v3”与 Ardunio UNO 连接并同时运行 BLYNK 应用程序。我有一个功能齐全的 GPS 模块在它自己的草图中工作,我还有一个功能齐全的 BLYNK 应用程序在它自己的草图中工作。但是,当我尝试组合代码以使 GPS 和 BLYNK 应用程序一起工作时,我的 GPS 代码卡在了一个 while 循环中。我认为这可能与我用于应用程序和 GPS 模块的软件串行通信有关,但我现在还在上大学,对学习这些概念还是很陌生。我只能想附上整个代码,这样你就可以看到发生了什么。

如果我在 Arduino 上运行此代码,那么我的串行监视器将显示以下内容:(请注意,BLYNK_WRITE(V11) 是 BLYNK 应用程序中的 GPS“小部件”更新时触发的中断)

但是,如果我只隔离与 cartGPS 相关的代码,那么串行监视器将显示:

这是预期的。

0 投票
1 回答
133 浏览

arduino - TCS34725 2 个月后停止

目前我正在做一个需要监控一些传感器的项目。我使用的传感器之一是 TCS34725 RGBC 光传感器。使用 Blynk,我将数据记录到数据库并将其显示在浏览器仪表板和 Blynk 应用程序上。让它运行 2 个月(大约)后,它停止读取该值。

此代码工作 2 个月。除了 TCS34725,我在连接到 WeMos D1 mini 的电路中还有 SHT31-D、7805 5V 稳压器和 3030 5V 风扇。唯一发生的事故是盒子(我放置所有电路的地方)下降了 10 - 20 厘米,并且仍然工作了几个星期。

我能得到的唯一值是当我重置我的 Wemos D1 mini 并且它会在发送 0 之前发送 1 个读数。

0 投票
1 回答
123 浏览

python-3.x - 如何将值作为整数返回

此代码打印值为:

等等...如何使它返回值作为整数?

像这样:

谢谢

0 投票
0 回答
135 浏览

c++ - 我想使用 Nodemcu 和 blynk 连接两个 yf-s201 水流传感器,一个作为流入,另一个作为流出

这主要是我在谷歌上找到的代码的复制粘贴,

我想使用 2 个水流传感器制作一个项目,其中 inflow() 显示我吸入了多少升,outflow() 显示流出了多少升。

这是我达到的程度,需要代码方面的帮助,我不是高级编码人员,因此非常感谢描述性代码和支持。另请参阅 maincode(),在该部分中我试图实现一个循环,我的意思是如果传感器 1 为高,则应显示传感器 1(流入())输出,如果传感器 2 为高,则应显示传感器 2(流出() ) 输出。

面临的问题:当我同时调用流入()和流出()时,输出不起作用,一个函数起作用,(我认为它与板的中断引脚有关?)。

0 投票
0 回答
199 浏览

button - 想要将按钮编码的程序更改为普通的开关按钮

所以基本上,我正在开发一个用于家庭自动化的反馈系统,它将连接到你的板的物理按钮的状态更新到Blynk应用程序上,这样你就可以通过手动和通过应用程序来控制你的灯。我正在使用ESP32板。连接到板的物理按钮的状态被获取并发送到blynk应用程序上的虚拟按钮,使用blynk的本机逻辑,即param.asInt()。因此我不能使用正常的逻辑像这样切换:

因为我必须使用以 param.asInt() 形式给出的 relay1State;更新 blynk 应用程序。另外,如果我使用这种类型的代码,我会在 blynk 应用程序中发生顺序切换:

所以因此我必须使用我的按钮状态逻辑来删除顺序切换。但我无法将它用作“按下打开,释放关闭”开关。它用作拨动开关-“按一次转动,再按一次将其关闭。” 我想将此逻辑更改为按下打开,释放关闭。请帮助我。谢谢!

0 投票
1 回答
1338 浏览

arduino-esp8266 - 带有超声波传感器的 Blynk 通知

这是我的代码,它在距离大于 150 时实际发送 blynk 通知。但它的输出非常奇怪。它一次又一次地运行设置功能,而不是只运行一次。由于此代码,esp8266 设备上线和下线,然后再次上线。你能告诉我为什么它一次又一次地运行设置函数以及为什么它打印堆栈......<<在输出而不是serial.print()函数。我不知道为什么?我是布林克的新手。

代码的输出如下所示:

.......它会一次又一次地继续打印。任何帮助将不胜感激。