Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setDigitalPinValue method creates a DIGITAL_MESSAGE message instead of a SET_DIGITAL_PIN_VALUE message #37

Open
HawaiianSpork opened this issue Oct 19, 2019 · 2 comments · Fixed by #59
Labels
2.5.x Planned for 2.5.x release

Comments

@HawaiianSpork
Copy link

HawaiianSpork commented Oct 19, 2019

This method is called setDigitalPinValue but it actually builds a DIGITAL_MESSAGE message:

https://github.com/kurbatov/firmata4j/blob/master/src/main/java/org/firmata4j/firmata/FirmataMessageFactory.java#L226

If you are using StandardFirmata.ino this can result in the wrong pin being changed since SET_DIGITAL_PIN_VALUE changes the value of a single pin where DIGITAL_MESSAGE changes the value for all pins on a port.

DIGITAL_MESSAGE
https://github.com/firmata/arduino/blob/master/FirmataConstants.h#L38

SET_DIGITAL_VALUE
https://github.com/firmata/arduino/blob/master/FirmataConstants.h#L44

@kurbatov kurbatov added the 2.5.x Planned for 2.5.x release label Jan 5, 2021
@kurbatov
Copy link
Owner

kurbatov commented Jan 5, 2021

Support of that message was added in v2.5 of the protocol. Currently firmata4j targets 2.3. We should add support of 2.4 features of the protocol before switching to that message to set pin's value.

@kurbatov
Copy link
Owner

Previous attempt to fix it #59 was reverted in #63

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.5.x Planned for 2.5.x release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants