Hi All
Finally got tired of using XScreensaver on the Beaglebone Black which does not have keyboard or mouse and has Touchscreen disabled.
To cancel the XScreensaver I had to shell out and send a command to it.
Messy.
So wrote a simple Date/Time screensaver that can be included in my code.(and thus easy to stop/start)
It is basically a small CGUI window with the Title as the Day name and date, then bitmaps that look like keys of a keyboard to show the digits.
However I would like to move it around the screen in random directions but a few pixels every 100 msec.
I concluded that due to the size of the (moving) window that the minimum X,Y = 1,1 and the maximum X,Y = 470,525
In CGUI there is a "SetWindowPosition(X,Y) so easy to reposition it every 100 mSec.
What I have NO IDEA on, is how to come up with those numbers.(X,Y)
I know there are many on the forum whom thrive in this area and would love to hear some suggestions.
Regards
Random Screen saver movement
Re: Random Screen saver movement
Funny, because you already have 'the solution' in the thread title.
Use a randomizer like Rnd(), to influence the new x, y position together
with a bit of math (to prevent that right/bottom gets 'off screen').
Remember that x, y represent: left/top (of image/bitmap).
For this, a ranging #Define may be useful, to limit min/max movement:
A word of warning, about ScreenSavers:
since I assume, that the BeagleBone is used for speed, I would rather just
'blank' the screen, than using a ScreenSaver which is consuming CPU power.
Use a randomizer like Rnd(), to influence the new x, y position together
with a bit of math (to prevent that right/bottom gets 'off screen').
Remember that x, y represent: left/top (of image/bitmap).
For this, a ranging #Define may be useful, to limit min/max movement:
Code: Select all
#Define LngRng(l, h) CLng(Int(Rnd * ((h) + 1 - (l)) + (l)))
A word of warning, about ScreenSavers:
since I assume, that the BeagleBone is used for speed, I would rather just
'blank' the screen, than using a ScreenSaver which is consuming CPU power.
Re: Random Screen saver movement
Hi All
Thanks for the reply MrSwiss.
I know that Screensavers are really no longer needed these days.
The screen has one rather large light bulb that is either On or Off.
They flick a single input switch (mechanical) to switch all the light in this museum.
That switch then cancels the screen saver so they can verify that all the lights changed.
Rather than the volenteers staring at a Light bulb all day , the screen saver comes in.
When I check the Wifi I simply ignore the screensaver and let it stop moving.
Will have some time to try this weekend.
Regards
Thanks for the reply MrSwiss.
I know that Screensavers are really no longer needed these days.
The screen has one rather large light bulb that is either On or Off.
They flick a single input switch (mechanical) to switch all the light in this museum.
That switch then cancels the screen saver so they can verify that all the lights changed.
Rather than the volenteers staring at a Light bulb all day , the screen saver comes in.
When I check the Wifi I simply ignore the screensaver and let it stop moving.
Will have some time to try this weekend.
Regards
Who is online
Users browsing this forum: No registered users and 15 guests