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

Adding code for finish box and stl files and blender files for printi… #2

Merged
merged 7 commits into from
Dec 12, 2019

Conversation

ppisl
Copy link
Collaborator

@ppisl ppisl commented Feb 26, 2018

Adding recent code for finish box and also stl files and blender files for printing boxes

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);
Copy link
Owner

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.

Copy link
Collaborator Author

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);
Copy link
Owner

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");

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);
Copy link
Owner

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.

Copy link
Collaborator Author

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);
Copy link
Owner

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);
Copy link
Owner

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)

@jtulach jtulach merged commit 7726b9b into jtulach:master Dec 12, 2019
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

Successfully merging this pull request may close these issues.

2 participants