You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to support host applications (StandardFirmata, AdvancedFirmata and ConfigurableFirmata are a "host applications") that don't use the capability query, each time a pin mode is set by the client, first check if the pin map contains a Pin object for that pin. If not, create an object for that pin and store it in the pin map. This way as long as clients specify pin modes, they should be able to use hosts that do not use capability queries.
May also need to first create a pin map with a range of pins set to a mode of DOUT (default). You wouldn't know what board is used in most cases so the range would have to be 0-64 or 0-128. This would support the case where a user expects the pins to be set to DOUT by default and therefore do not set a pin mode before attempting to use a pin.
The text was updated successfully, but these errors were encountered:
It may actually only require initializing all pins to digital on startup if the host doesn't issue a capability query on startup:
// call from checkForQueryResponse if _capabilityQueryResponseReceived === false
initPins: function(){for(vari=0;i<128;i++){varpin=newPin(i,Pin.DOUT);this._digitalPinMapping[i]=i;this.managePinListener(pin);this._ioPins[i]=pin;}}
And then whenever a pin is used, make sure its type is properly set.
In order to support host applications (StandardFirmata, AdvancedFirmata and ConfigurableFirmata are a "host applications") that don't use the capability query, each time a pin mode is set by the client, first check if the pin map contains a Pin object for that pin. If not, create an object for that pin and store it in the pin map. This way as long as clients specify pin modes, they should be able to use hosts that do not use capability queries.
May also need to first create a pin map with a range of pins set to a mode of DOUT (default). You wouldn't know what board is used in most cases so the range would have to be 0-64 or 0-128. This would support the case where a user expects the pins to be set to DOUT by default and therefore do not set a pin mode before attempting to use a pin.
The text was updated successfully, but these errors were encountered: