Time input with Nodemcu rtc

Hello, i am trying to make a project that would allow me to use set time widget in blynk app to control relay on and off using Nodemcu esp8266 . I am a begginer and my code is showing errors as currentTime is not declared in scope when i try to use it outside the function . If u can help thanks . I read many topics but still can’t do it. I know its simple but i am real begginer and would be saved if u can help me write the code .

Read through this topic for a better understanding of the Time Input Widget.

This probably is due to bad coding, but you didn’t show what you have, not that this is a code mechanics shop anyhow :stuck_out_tongue_winking_eye: … Look at this link concerning the scope of variables and how to declare them in your code.

https://www.arduino.cc/reference/en/language/variables/variable-scope--qualifiers/scope/

1 Like

Sorry , i am finding it hard to upload my program .
My question is can i compare the value stored in a string variable (from rtc eg) and int variable (simple time input eg ) and make a pin high or low . When i tried it gave error and when i declared it globally it gave no value in serial monitor .