Clouds and Lightining Effects using standard PWM channels

Would you like to help?
Share your walkthrough tutorial with others

Posts: 12288
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Wed Aug 22, 2012 10:46 am
Just to draw zeros.
Otherwise, when you go from for example 17:10 to 9:32, if you don't clear or draw zeros, you would see 19:32 instead of 09:32.
Roberto.
User avatar
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL
PostPosted: Wed Aug 22, 2012 10:47 am
ok...so should they overlap???? or be in a different location of them?
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative

Posts: 12288
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Wed Aug 22, 2012 10:48 am
Yes, they should overlap, so you actually draw over the 00:00
Roberto.
User avatar
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL
PostPosted: Wed Aug 22, 2012 10:52 am
For both the
if ((cloudstart/60)>=10) x=11; else x=17;
ReefAngel.LCD.DrawText(0,255,48,57,(cloudstart/60));
if ((cloudstart%60)>=10) x=29; else x=35;
ReefAngel.LCD.DrawText(0,255,40,57,(cloudstart%60));

Both should overlap 00:00?
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative

Posts: 12288
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Wed Aug 22, 2012 11:01 am
I don't think that will work.
That's what the x is for.
When it is >=10, it's 2 digits and you have to offset the drawing by 6 pixels.
So, I think it should be something like this for the hour:
if ((cloudstart/60)>=10) x=40; else x=46;
And same thing for the minutes.
if ((cloudstart%60)>=10) x=48; else x=54;
Roberto.
User avatar
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL
PostPosted: Wed Aug 22, 2012 11:06 am
got it:

And the last position?
if (cloudchance && (NumMins(hour(),minute())<cloudstart))
{
int x=0;
if ((cloudstart/60)>=10) x=11; else x=17;
ReefAngel.LCD.DrawText(0,255,x,120<----(should be 57?),(cloudstart/60));
if ((cloudstart%60)>=10) x=29; else x=35;
ReefAngel.LCD.DrawText(0,255,x,120<----(should be 57?),(cloudstart%60));
}

For proper placement?
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative

Posts: 12288
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Wed Aug 22, 2012 11:08 am
yes
Roberto.
User avatar
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL
PostPosted: Wed Aug 22, 2012 11:09 am
Never knew about the overlap thing...very cool idea. Thanks a ton!
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
User avatar
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL
PostPosted: Wed Aug 22, 2012 11:22 am
Still a little confused...I removed the 00:00 to see what was going on under it and it looks like this:

Image

If I add the 00:00 back...it is just what you see with the 00:00 over it


If I try to do adjustments for x...they just dissapear.
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
User avatar
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL
PostPosted: Wed Aug 22, 2012 11:36 am
Flipped them


int x=0;
if ((cloudstart/60)>=10) x=48; else x=54;
ReefAngel.LCD.DrawText(0,255,x,57,(cloudstart/60));
if ((cloudstart%60)>=10) x=40; else x=46;
ReefAngel.LCD.DrawText(0,255,x,57,(cloudstart%60));
}


...now have this


Image
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
PreviousNext

Return to Tutorials

Who is online

Users browsing this forum: Google [Bot] and 2 guests