Reply To: Multi User – PIN CHANGE Event
About › Forums › Forum › Multi User – PIN CHANGE Event › Reply To: Multi User – PIN CHANGE Event
If I expose queryPinState() in the API you’ll be able to monitor any pin. This purpose for pin state queries is for GUI monitoring of the current state of the Arduino: http://firmata.org/wiki/Protocol#Pin_State_Query_.28added_in_version_2.2.29. I discovered a bug in the query last night that may be on the firmata side. I’ll try to resolve it and make the method public sometime over the weekend. However in order to use the query you will have to poll. There is no way to get an event when an output pin changes. There was also a reason at one time I made this method private but it was so long ago I forgot the exact reason so I’ll have to do a lot of testing and perhaps some refactoring before I make it fully public again.
Also by writing custom firmata firmware instead of using StandardFirmata you have full control over what data is sent between Arduino and JavaScript… it’s just harder than using StandardFirmata because you have to maintain your own Sysex or String protocols to handle communication. Breakout and the core Firmata library (not to be confused with the StandardFirmata implementation) will provide callbacks and parse the sysex or string values for you but provide no additional value at that point (other than the Breakout Server functionality of course). I’m planning to add a Guide on writing custom firmware for Breakout.