Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • Try int prevState = -1; //-1= not initialized, 0=open, 1=closed Commented Jun 14, 2022 at 0:54
  • 2
    The payload of the radio packet appears to be the number of the digital pin on which the sensor is attached: int state = digitalRead(data.val); Is that what you intend? Commented Jun 14, 2022 at 2:38
  • please copy and paste the content of the serial console to your question above ... please no screenshots Commented Jun 14, 2022 at 4:14
  • 1
    Just out of curiosity, why are you including key definitions for the Danish, German, Spanish, French, Italian and Swedish keyboard layouts? Commented Jun 14, 2022 at 9:37
  • Consider using an enum for prevState instead of values 0, -1, 1; it makes the program easier to read/maintain. Commented Jun 14, 2022 at 11:51