Hot answers tagged

2

The function digitalRead() has only one argument: the digital pin that you want to know the state (high or low). You must change the use of this function, to something like this: int state = digitalRead(nilai_sensor) if (state == low) { //do something here } Hope you can find helpfull :D


2

You had the following general problem: The code you were using was configuring a pin into INPUT mode and reading the value on it. On this pin you conencted a button without extern pullup or pulldown resistor. This means that if the button is not pressed, it is not connected to anything and thus a floating pin. You cannot realibly read the value of the ...


1

Can I directly connect an ESP GPIO pin to the base of the transistor where the arduino is connected? No. You will effectively be connecting two outputs together, and that is very bad. Instead you will need to add a second transistor in parallel to the first - one controlled by the Arduino and one controlled by the ESP-01. Can I put a relay module ...


1

Yes it is possible. Use the Blynk example sketch to activate the pin of the esp8266. Read the pin of the esp8266 with the ATMega. Handle in ATmega sketch the esp8266 pin as a second button.


1

By prefixing your pinData variables with int, you are declaring local variables in your BLYNK_WRITE() functions, whose scope is only in that function. The local version is written to, instead of the global. To fix this, do not declare a new variable in BLYNK_WRITE(): BLYNK_WRITE(V3) //Button Widget is writing to pin V1 { pinData = param.asInt(); } ...


1

Maybe you use the wrong baudrate with your hardware serial. Your tutorial states, that 38400 baud is the default, but I found other sources (HC-05), that say the default is 9600 baud (which is also true for my HC-06 modules). Try 9600 baud and if it still doesn't work try some other standard baudrates.


1

BLYNK_READ() is documented as: BLYNK_READ(vPIN) BLYNK_READ defines a function that is called when device is requested to send it’s current value of Virtual Pin to the server. That means it is called when the app or the Blynk server requests a state from the hardware/sketch, such as when the app first connects or reconnects to the Blynk server, or ...


1

The BLYNK_WRITE(V1) function is only called when a Blynk app widget sends data to your hardware. It does not run in a loop. If you want something to run in a loop, put it in loop(). The WRITE aspect is from the point of view of the App, not of your hardware, so your hardware uses BLYNK_WRITE() to receive information from the app. And it's only called when ...


Only top voted, non community-wiki answers of a minimum length are eligible