-
Notifications
You must be signed in to change notification settings - Fork 1
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
Adding code for finish box and stl files and blender files for printi… #2
Conversation
Fix for: Issue jtulach#1- The time in event can be wrong.
arduino/finishBox/finishBox.ino
Outdated
unsigned long seconds = 0; | ||
unsigned long milliSeconds = 0; | ||
phone->getCurrentUnixTimeStamp(&seconds, &milliSeconds); | ||
sprintf(cmd, "http://skimb.xelfi.cz/timing/add?when=%ld%03d&type=FINISHBOX_STARTED", seconds, milliSeconds); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer type=FINISH_INITIALIZED
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
phone.getCurrentUnixTimeStamp(&seconds, &milliSeconds); | ||
int size = sprintf(cmd, "http://skimb.xelfi.cz/timing/add?when=%ld%d&type=FINISH", seconds, milliSeconds); | ||
phone->getCurrentUnixTimeStamp(&seconds, &milliSeconds); | ||
int size = sprintf(cmd, "http://skimb.xelfi.cz/timing/add?when=%ld%03d&type=FINISH", seconds, milliSeconds); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can save even more space by doing sharing the string:
sprintf(cmd, "http://skimb.xelfi.cz/timing?add?when%ld%03d&type=%s", seconds, milliSeconds, "FINISH");
sprintf(cmd, "http://skimb.xelfi.cz/timing?add?when%ld%03d&type=%s", seconds, milliSeconds, "FINISH_INITIALIZED");
arduino/startBox/startBox.ino
Outdated
unsigned long seconds = 0; | ||
unsigned long milliSeconds = 0; | ||
phone->getCurrentUnixTimeStamp(&seconds, &milliSeconds); | ||
sprintf_P(cmd, PSTR("http://skimb.xelfi.cz/timing/add?when=%ld%03d&type=STARTBOX_STARTED"), seconds, milliSeconds); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer type=START_INITIALIZED
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
lcd->setCursor(0, 1); | ||
lcd->print(F("Odstartovano")); | ||
playStartMelody(); | ||
sprintf_P(cmd, PSTR("http://skimb.xelfi.cz/timing/add?when=%ld%03d&type=START"), seconds, milliSeconds); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, it might save some memory using %s
for the type
. Possibly this could even be made a helper utilitity in Phone
as all the URL connections are the same.
delay(BREAK_AFTER_SENDING); | ||
lcd->setCursor(0, 2); | ||
lcd->print(F("Posilani casu startu")); | ||
phone->sendRequest(cmd); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be phone->sendRequest(type, seconds, milliSeconds)
Adding recent code for finish box and also stl files and blender files for printing boxes