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

PrintEx doesn't handle multiple parameters correctly? #37

Open
paynterf opened this issue Mar 31, 2020 · 0 comments
Open

PrintEx doesn't handle multiple parameters correctly? #37

paynterf opened this issue Mar 31, 2020 · 0 comments

Comments

@paynterf
Copy link

Fin1 & Fin2 are long ints (4 bytes) on an Arduino Mega, and 'SteeringValue' is a float. This code:

Serial.print("Fin1 = "); Serial.print(Fin1); Serial.print(", "); Serial.print("Fin2 = "); Serial.print(Fin2); Serial.print(", "); Serial.print("SteeringValue = "); Serial.println(SteeringValue); mySerial.printf("Fin1 = %d, Fin2 = %d, SteeringValue = %3.2f\n", Fin1, Fin2, SteeringValue);
Produces this output on an Arduino Mega 2560

Fin1 = 9185, Fin2 = 18370, SteeringValue = 28851.73 Fin1 = 9185, Fin2 = 0, SteeringValue = 0.00
Why is this?

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

No branches or pull requests

1 participant