Skip to content

Added sun, moon, and local time #35

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

Merged
merged 1 commit into from
Jun 28, 2016
Merged

Conversation

a1rb4Ck
Copy link
Contributor

@a1rb4Ck a1rb4Ck commented Jun 28, 2016

Based on bHogan suggestions, I found it really great, so I simply put his changes here and keep all credits to him. Hope it may help. I also added a bool usePM if you need or not a 24h day display. See here for bHogan originals : #32

Based on bHogan suggestions, I found it really great, so I simply put his changes here and keep all credits to him. Hope it may help. I also added a bool usePM if you need or not a 24h day display. See here for bHogan originals : ThingPulse#32
@squix78 squix78 merged commit 15b5a8b into ThingPulse:master Jun 28, 2016
@squix78
Copy link
Collaborator

squix78 commented Jun 28, 2016

Thank you a lot @a1rb4Ck and @bHogan2 for your work!

@bHogan2
Copy link

bHogan2 commented Jun 28, 2016

My pleasure!

@stony2k
Copy link
Contributor

stony2k commented Jul 2, 2016

Hey bHogan2,

Would you mind to add some astronomy frames to the example?

@a1rb4Ck
Copy link
Contributor Author

a1rb4Ck commented Jul 2, 2016

In waiting for bHogan2's nice sun rise and fall pictures, this is my not so nice implementation: https://github.com/a1rb4Ck/esp8266-weather-station-platformio-demo/blob/DEV/src/main.cpp#L364

@squix78
Copy link
Collaborator

squix78 commented Jul 2, 2016

Looks cool! Any chance to get some pics or a video for posting on my blog/Twitter?

Sent from my iPhone

On 02.07.2016, at 14:38, Pierre [email protected] wrote:

In waiting for bHogan2's nice sun rise and fall pictures, this is my not so nice implementation: https://github.com/a1rb4Ck/esp8266-weather-station-platformio-demo/blob/DEV/src/main.cpp#L364


You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or mute the thread.

@bHogan2
Copy link

bHogan2 commented Jul 2, 2016

Daniel,
Sorry, I don't have the time to upload the new lib and re-install my changes, but here are the routines I used for sun and moon (2 separate frames).

// My Sun frame
void drawFrame4(OLEDDisplay display, OLEDDisplayUiState state, int16_t x, int16_t y) {
ui.setTimePerFrame(frameTime); // default frame time
display->setFont(ArialMT_Plain_24);
display->setTextAlignment(TEXT_ALIGN_CENTER);
String SunriseTime = wunderground.getSunriseTime();
display->drawString(75 + x, 0 + y, SunriseTime);
String SunsetTime = wunderground.getSunsetTime();
display->drawString(75 + x, 30 + y, SunsetTime);

display->setFont(Meteocons_Plain_21);
display->setTextAlignment(TEXT_ALIGN_LEFT);
display->drawString(x + 10, y + 4, "1");
display->drawString(x + 10, y + 34, "J");
}

// My Moon frame
void drawFrame5(OLEDDisplay display, OLEDDisplayUiState state, int16_t x, int16_t y) {
ui.setTimePerFrame(frameTime); // default frame time
display->setFont(ArialMT_Plain_16);
display->setTextAlignment(TEXT_ALIGN_CENTER);
//String MoonAge = wunderground.getMoonAge(); // not used
String MoonPctIlum = wunderground.getMoonPctIlum();
String MoonPhase = wunderground.getMoonPhase();
display->drawString(64 + x, 0 + y, MoonPhase);
display->drawString(64 + x, 16 + y, MoonPctIlum + "% full");

Maybe that will help.
I replaced 'precipitation' in that frame with wind speed and direction...
// Humidity, Pressure, Wind Speed and direction
void drawFrame2(OLEDDisplay display, OLEDDisplayUiState state, int16_t x, int16_t y) {
ui.setTimePerFrame(frameTime + 2000); // add 2 seconds for this frame
display->setTextAlignment(TEXT_ALIGN_CENTER);
display->setFont(ArialMT_Plain_10);
display->drawString(32 + x, 0 + y, "Humidity");
display->drawString(96 + x, 0 + y, "Pressure");
display->drawString(32 + x, 28 + y, "Wind Speed");
display->drawString(96 + x, 28 + y, "Direction");

display->setFont(ArialMT_Plain_16);
display->drawString(32 + x, 10 + y, wunderground.getHumidity());
display->drawString(96 + x, 10 + y, wunderground.getPressure());
//display->drawString(32 + x, 38 + y, wunderground.getPrecipitationToday());
display->drawString(32 + x, 38 + y, wunderground.getWindSpeed());
display->drawString(96 + x, 38 + y, wunderground.getWindDir());
}

For what this is worth!
John

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.

4 participants