Omnimaga

Calculator Community => TI Calculators => TI-BASIC => Topic started by: dreamdragon on January 29, 2014, 01:49:44 pm

Title: Ti 84+cse prgming questions
Post by: dreamdragon on January 29, 2014, 01:49:44 pm
hey guys!
i really want to prgm a strobe light for my calc...
however i dont know how to implement the drawing commands...
no one seems to come up with new prgms for the calc so i wish to be the spark that starts the inferno so-to-speak  8)
Title: Re: Ti 84+cse prgming questions
Post by: JWinslow23 on January 29, 2014, 01:59:16 pm
Well...I can't help you there.

I don't have much CSE experience either, and my recent practice with the BackgroundOn command was to no avail.

I just don't think it's fast enough.
Title: Re: Ti 84+cse prgming questions
Post by: ben_g on January 29, 2014, 03:26:16 pm
hey guys!
i really want to prgm a strobe light for my calc...
however i dont know how to implement the drawing commands...
no one seems to come up with new prgms for the calc so i wish to be the spark that starts the inferno so-to-speak  8)
I think drawing will always be rather slow for a strobe light. I think the best you can do is making the screen completely white, and then use some asm code to turn the backlight of the LCD on(at maximum brightness) and off in a loop (with some delay, off course).
Title: Re: Ti 84+cse prgming questions
Post by: DJ Omnimaga on January 29, 2014, 03:41:32 pm
I don't know what happened to my post, since I posted earlier, but which drawing commands do you need help in? I know TI-BD wiki has a lot of doc, but it doesn't include the extra color arguments.
Title: Re: Ti 84+cse prgming questions
Post by: fb39ca4 on January 29, 2014, 08:28:47 pm
I believe it was calculated that the theoretical maximum framerate when drawing a solid color to the screen was 7FPS. You could double that by using the half-horizontal resolution mode, but this is all using assembly language.
Title: Re: Ti 84+cse prgming questions
Post by: DJ Omnimaga on January 29, 2014, 09:40:07 pm
Actually I think it's closer to 5 FPS, according to a program by Kerm. However, if you invert the LCD using the built-in features it's practically instant inverting.
Title: Re: Ti 84+cse prgming questions
Post by: dreamdragon on January 30, 2014, 08:03:02 am
I don't know what happened to my post, since I posted earlier, but which drawing commands do you need help in? I know TI-BD wiki has a lot of doc, but it doesn't include the extra color arguments.

i was wondering if i could use the pxlon/off/change....  <_<
i would like to bet that that would work...... ;)
(lol redundancy that makes sense.... "bet that that...."  ;D )
Title: Re: Ti 84+cse prgming questions
Post by: ben_g on January 30, 2014, 09:05:19 am
I don't know what happened to my post, since I posted earlier, but which drawing commands do you need help in? I know TI-BD wiki has a lot of doc, but it doesn't include the extra color arguments.

i was wondering if i could use the pxlon/off/change....  <_<
i would like to bet that that would work...... ;)
(lol redundancy that makes sense.... "bet that that...."  ;D )
Pxl-on/off/change will be way to slow for a strobe light. Even on the b&w calculators, filling the entire screen with Pxl-on takes nearly a minute. Unless you are fine with a strobe light of only 1 pixel.
Title: Re: Ti 84+cse prgming questions
Post by: dreamdragon on January 30, 2014, 09:05:55 am
what about alota pixels?
Title: Re: Re: Ti 84+cse prgming questions
Post by: DJ Omnimaga on January 30, 2014, 01:40:41 pm
About 4 3x3 squares with an empty 7x7 square surrounding them will most likely blink at 6-7 frames per second max. I am unsure if it's accurate, but I once used pt-on/off to draw Link sprites and that's approximately what I got.
Title: Re: Ti 84+cse prgming questions
Post by: dreamdragon on January 30, 2014, 02:07:54 pm
i actaully just made it in 30 secconds.... ._.
if one examines the real( statements in col mode on can actually put the invert and default settings of the display and have them loop...
like...

Clrhome
lbl0
real(0,3,2     <- this inverts it
real(0,3,0    <- this one and the below one switches it back to default
real(0,3,3    
Goto 0

it was so freakin easy ;D(http://www.omnimaga.org/Themes/default/images/gpbp_arrow_up.gif)
and the result is more than i expected  :w00t:
the speed between the three real(s      is so quick that it actually looks like a strobe light..
it was so freakin awesome the first time i ran it...
i created another that makes the graph screen strobe...
hell there is like no decrease in speed even with an image on...
however if i have graph/table selected it really slows down...
but i have a technical question:
if i left it running the strobe light could i damage the screen? D:
Title: Re: Ti 84+cse prgming questions
Post by: Hayleia on January 30, 2014, 02:50:33 pm
Could you replace that "Lbl 0" with "While 1" and "Goto 0" with "End" ? I recall from when I was programming in Basic for my 83+ that While loops were faster than Gotos, and I read somewhere that memory leaks can occur with Gotos.
Title: Re: Ti 84+cse prgming questions
Post by: fb39ca4 on January 30, 2014, 04:40:57 pm
Never heard of screen damage from strobes. In fact, the method for producing grayscale on monochrome displays strobes the pixels in a checkerboard pattern, and strobing is used to fix stuck pixels.
Title: Re: Ti 84+cse prgming questions
Post by: dreamdragon on January 30, 2014, 04:48:30 pm
Could you replace that "Lbl 0" with "While 1" and "Goto 0" with "End" ? I recall from when I was programming in Basic for my 83+ that While loops were faster than Gotos, and I read somewhere that memory leaks can occur with Gotos.

what a great idea! i will go back into my five lines of code and alter them....
although i have to admit the speed with gotos is insane....

Title: Re: Ti 84+cse prgming questions
Post by: Lunar Fire on January 30, 2014, 07:19:14 pm
In time, you'll learn that the Goto command is counter-indicated in almost all of the programming languages existing, because it breaks the flow of your program. In TI-BASIC thought there is a lack of essential alternatives (like subroutines), so you can't really avoid it.

However, your case is one in which you can use a more efficient structure, which is the While loop. It will make your code a bit faster and you can program an exit condition if you need to.

I'm going to give you an exit condition to try out. How would you change your code to exit the strobe by clicking Enter?

To do this you'll want to know how the While condition works (why While 1 loops infinitely) and how to read keystrokes. After that it should be fairly easy to pull it off.

Good luck ;D
Title: Re: Ti 84+cse prgming questions
Post by: dreamdragon on January 30, 2014, 08:03:16 pm
In time, you'll learn that the Goto command is counter-indicated in almost all of the programming languages existing, because it breaks the flow of your program. In TI-BASIC thought there is a lack of essential alternatives (like subroutines), so you can't really avoid it.

However, your case is one in which you can use a more efficient structure, which is the While loop. It will make your code a bit faster and you can program an exit condition if you need to.

I'm going to give you an exit condition to try out. How would you change your code to exit the strobe by clicking Enter?

To do this you'll want to know how the While condition works (why While 1 loops infinitely) and how to read keystrokes. After that it should be fairly easy to pull it off.

Good luck ;D

gah....
what a callenge u have left me indeed!
Title: Re: Ti 84+cse prgming questions
Post by: DJ Omnimaga on January 30, 2014, 11:27:52 pm
Regarding strobe lights, just be careful with epilleptic people.
Title: Re: Ti 84+cse prgming questions
Post by: The_King on January 30, 2014, 11:42:57 pm
Regarding strobe lights, just be careful with epilleptic people.

just a question to ask if u r epileptic perhaps ???
Title: Re: Re: Ti 84+cse prgming questions
Post by: DJ Omnimaga on January 30, 2014, 11:44:50 pm
Nope. Just making sure he is careful since we never know who could be. :P
Title: Re: Ti 84+cse prgming questions
Post by: The_King on January 30, 2014, 11:45:52 pm
i might be
which means he better be
Title: Re: Ti 84+cse prgming questions
Post by: dreamdragon on February 01, 2014, 01:12:27 pm
i might be
which means he better be

im not seizer prone, sadly.  :evillaugh:
Title: Re: Ti 84+cse prgming questions
Post by: dreamdragon on February 01, 2014, 09:48:00 pm
heres the prgm
Title: Re: Ti 84+cse prgming questions
Post by: DJ Omnimaga on February 02, 2014, 11:40:50 am
Ok thanks. I actually copied the code easily by hand, though. :P By the way, although I don't necessarily see the use of running this non-stop alone or for prolonged periods of time, I think this can be useful in game animations, for example if someone makes a Zelda or Final Fantasy game and certain magic spells are used. The only annoyance is if the player exits with ON and the calc remains inverted, but the game author just have to warn users to not exit during animations. A lot of NES and SNES games used such animation.