在blynk应用程序中将模拟引脚关联到虚拟引脚以实现事件处理

时间:2019-05-09 21:51:08

标签: blynk arduino-mkr1000

我是新手,我尝试在线搜索,但没有找到解决方案。我真的不知道我在做什么错。它可以完美连接,并在标记值显示屏上读取模拟读数。但是,当我尝试确定虚拟针时却没有。请帮忙。

#include <SPI.h>
#include <WiFi101.h>
#include <BlynkSimpleMKR1000.h>

char auth[] = "***";

/*#include "arduino_secrets.h"*/
///////please enter your sensitive data in the Secret 
tab/arduino_secrets.h
char ssid[] = "***";        // your network SSID (name)
char pass[] = "***";    // your network password (use for WPA, or         use as key for WEP)
int status = WL_IDLE_STATUS;     // the WiFi radio's status

void setup() {
  // put your setup code here, to run once:
  // Debug console
  Serial.begin(9600);

  Blynk.begin(auth, ssid, pass);
  // You can also specify server:
  //Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 80);
  //Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8080);
}

void loop(void) {
  // put your main code here, to run repeatedly:
 Blynk.run();
}

 BLYNK_WRITE(V5) {
  int pinValue = analogRead(A0);
  Blynk.virtualWrite(V5, pinValue);
 }

0 个答案:

没有答案