I am trying to communicate a command between to particles. I have a magnetic switch, that when closed reads 3.3V and when open, reads about 80mv. I am trying to have it that when the photon with the switch reads the 80mv, it communicates with my other photon to turn a specific pin on.
Is there anyone who might have insight?
Thanks,
Tyler
@tcheek38, the subscribing Photon has a “myHandler()” function (see example in the docs). If that handler is dedicated to a specific event (eg pin is low) then you don’t need to do anything but do the pin action you need.
To be more sophisticated, the publishing Photon could send various conditions in the publish string. The subscribing Photon’s handler could then parse that string to take different/multiple actions based on the received string.
If you look a the PUBLISH example app in the web IDE, you will get an idea of what I mean.