![]() |
Forum Index : Microcontroller and PC projects : Screensavers....
Author | Message | ||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9588 |
Hi folks. ![]() I need some cute screensaver-type demos I can run in the background when a certain time has elapsed on an LCD screen. I am immediately drawn to use the same demo that is now embedded into the MM+ as the GUI TEST LCDPANEL command, but was a seperate demo program for the Colour Maximite series of computers: SetTick 0,SST,2:SetTick 0,DAT,1:SS=0':watchdog SET*2 Backlight 25 Cls:Font 2:cx = MM.HRes/2 : cy = MM.VRes/2 TEXT 50,100,"SCREENSAVER",rgb(White):font 1 TEXT 50,200,"Press any key...",Rgb(White) Do SS=SS+1:x = Rnd * MM.HRes:y = Rnd * MM.VRes Do c = Int(Rnd * 6) + 1 Loop Until Pixel(x, y) <> c d = Sqr(Abs(x-cx)^2 + Abs(y-cy)^2) r = Rnd * d/8 + 2 + d/14 Circle (x,y), r, c, f If r > Rnd*8 + 13 Then Circle (x,y), r+1, 0 If Touch(DOWN)=1 Then EXIT if SS=250 then goto ScreenSaver if loc(#2)<>0 then ST=0:goto Activity pause 100 Loop ST=0:goto start The above code is a slightly modified version, and is generating an error at the moment: "Error: PIXEL not declared." - which is odd, as PIXEL is a command which SHOULD work..... ![]() So, does anyone have any cute kind of demo routines I can use for Screensaver purposes? The routine needs to be fully self-contained and not rely on anything else other then normal MMBASIC commands. Part of the routine is checking if touch has been touched, or anything is in the serial buffer for COM2(as you can see above), and in those cases, the Screensaver routine is stopped automatically. Pretty standard. ST is a counter running in a SETTICK to keep track of how long it has been since the screen was touched or something happened. This is reset to zero in several routines, but if it can count up to two minutes, the screen-saver is invoked and displayed. Smoke makes things work. When the smoke gets out, it stops! |
||||
BobD![]() Guru ![]() Joined: 07/12/2011 Location: AustraliaPosts: 935 |
Grogs get rid of the brackets or parentheses after pixel. Try pixel x,y Bob |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3282 |
In the standard firmware for the Micromite PIXEL is a command, not a function - so this is why MMBasic is complaining... because the PIXEL() function has not been declared. I say "standard firmware" because PeterM might have implemented it as a function in one of his releases. It was also available as a function in the Maximite MMBasic. Geoff Geoff Graham - http://geoffg.net |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |