Omnimaga
Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: JosJuice on November 14, 2010, 06:06:48 am
-
TimeTools is a small TI-BASIC program I've been working on for a while. It displays the current time (both digital and analog display), and also has a timer that has the ability to continue even when TimeTools is not running. It only runs on TI-84+(SE) since the clock is used.
I've tried to optimize this as much as I could. The screen is only updated when needed, and the whole program is about 1 kB. Usually, it runs at about 5 FPS.
(http://www.ticalc.org/archives/files/ss/817/81796.gif)
http://www.ticalc.org/archives/files/fileinfo/433/43347.html (http://www.ticalc.org/archives/files/fileinfo/433/43347.html)
-
The hands are done via sin( and cos( in degree mode. At zstandard, Lsin(A) gives the y coordinate for a hand L long and at the angle A. A goes from 0-360, so for the second hand, it goes 60 times in a minutes or 360 degrees, which means it goes 1 time in a second or 360/60=60 degrees. Also note that the pair (cos(0),sin(0)) produces (1,0) which means that you are going to have to shift the degrees by 90. So that way, at 0 seconds, it would be (cos(0+90),sin(0+90)) which is (0,1) the correct start of the clock. To have an offset, just add the x and y coordinates outside the sine and cosine. Also note that that click will go counterclockwise, so you must negate the entire angle measure inside the cos( and sin( brackets. Good luck. I would try a simple clock the size of the screen first, though.
-
Also note that the pair (cos(0),sin(0)) produces (1,0) which means that you are going to have to shift the degrees by 90. So that way, at 0 seconds, it would be (cos(0+90),sin(0+90)) which is (0,1) the correct start of the clock.
Actually, that would make it go backwards (counterclockwise). An easier (and smaller) way to do it is sin( for X and cos( for Y.
This project looks pretty nice, especially for a first project. 5 FPS is a pretty good speed for BASIC :D
-
Interesting, I'm curious how this will turn out. :)
-
I've managed to draw the hands of the clock, but everything isn't done yet. I need to make the hands I drew the previous minute disappear, and some other stuff :P
Is it possible to recall a Pic when in Horiz mode? It doesn't seem to work for me.
-
It should work, but it only shows the top half. The bottom half gets cut off, unfortunately.
-
(http://i152.photobucket.com/albums/s183/JosJuice/random135.png)
Looks great, so, we need to set time i the 'Mode' button before using the program?
EDIT: Just tried it in Wabbit, yes we do, indeed, maybe add an option for us to set time, if possible?
EDIT2: Also, it displays "ednesday" instead of "Wednesday" :s
-
If you want to set the time, then you can use the setTime( command in TI-OS. It takes Hour, minute, and second as the arguments. You might just want to trim it to Hour and minute.
-
If you want to set the time, then you can use the setTime( command in TI-OS. It takes Hour, minute, and second as the arguments. You might just want to trim it to Hour and minute.
I prefer to go to Mode :), it's much simpler and lets tou set date format and everything!
-
If you want to set the time, then you can use the setTime( command in TI-OS. It takes Hour, minute, and second as the arguments. You might just want to trim it to Hour and minute.
I prefer to go to Mode :), it's much simpler and lets tou set date format and everything!
This looks better in my opinion :P
I see how you have decent timer controls in there, great, becuase I used to have to make a BASIC program every time I wanted to use a timer function. And even then, that timer isn't fully accurate.
Great work so far! Keep up the great work! When it's finished I will probably put it on my real calc too ;)
NOOO I DON'T HAVE 666 POSTS ANYMOREZ :( I HAD THART FOR ONE WHOLE DAY TOO :P
EDIT: and 5 fps is fine for a BASIC prog. if it were asm however, we'd be expecting a fps of >9000. ;)
-
If you want to set the time, then you can use the setTime( command in TI-OS. It takes Hour, minute, and second as the arguments. You might just want to trim it to Hour and minute.
I prefer to go to Mode :), it's much simpler and lets tou set date format and everything!
The setTime( and the SetDate( functions are the same ones that TI-OS uses in the Mode menu :P
-
I fixed the ednesday glitch earlier today (didn't notice it earlier, because the current screen erasing routine was written on Thursday last week...) The fix isn't uploaded yet, though (TI-Connect refuses to connect with my calc right now).
Also, adding an option to set the time might be a bit tricky. The code is not designed for going to a second screen while the program is running and then go back, but I'll see if it's possible to make something anyway.
-
I fixed the ednesday glitch earlier today (didn't notice it earlier, because the current screen erasing routine was written on Thursday last week...) The fix isn't uploaded yet, though (TI-Connect refuses to connect with my calc right now).
Also, adding an option to set the time might be a bit tricky. The code is not designed for going to a second screen while the program is running and then go back, but I'll see if it's possible to make something anyway.
Great, hope you can make it, though!
-
This is sounding and looking great :) Great job!
-
This looks cool. Good luck getting 'settime' to work. :)
-
This looks cool. Good luck getting 'settime' to work. :)
That would be sweet :)
-
That looks very nice. If it was possible to make it on the TI-83+ it would be greatly appreciated.
-
To make an accurate clock/timer on an 83+ you would need to utilize assembly by making an interrupt system that would constantly update the clock. And then you would have to make sire nothing MESSES with that interrupt in the OS. So it's possible, but not in a BASIC program.
-
Ah i see. Thanks man.
-
The analog clock is getting close to completion. Everything that's left are just some optimizations.
I'm making some progress on the set time function, but it's not usable yet. I might try to make a "countdown to" function after that, but the code was never designed for that so it's definitely going to be a bit tricky.
-
The analog clock is getting close to completion. Everything that's left are just some optimizations.
I'm making some progress on the set time function, but it's not usable yet. I might try to make a "countdown to" function after that, but the code was never designed for that so it's definitely going to be a bit tricky.
Cool the analog is going good, it would be impossible for me :s
-
1.0 has been released (it's in the first post of the topic). The analog clock is completed, but the set time feature is not included in this version. I might make a 1.1 version that includes this, but I'm not too sure.
-
1.0 has been released (it's in the first post of the topic). The analog clock is completed, but the set time feature is not included in this version. I might make a 1.1 version that includes this, but I'm not too sure.
It would be cool! Make it easier than the 'Mode' button please.
-
What do you mean by easier? The actual input of time and date is pretty simple... Is the problem that navigation to the correct menu item is required before the clock can be set? s:
-
What do you mean by easier? The actual input of time and date is pretty simple... Is the problem that navigation to the correct menu item is required before the clock can be set? s:
In Mode, you have to scroll down many options to set time, in your program that won't be needed, I hope. WAIT; THE ANALOG CLOCK IS FINISHED! Very well!
-
The way I've planned it, pressing F4 will open the set time screen immediately (well, as immediately as things can be in TI-BASIC...)
-
The way I've planned it, pressing F4 will open the set time screen immediately (well, as immediately as things can be in TI-BASIC...)
Ohh, that's good as well! yeah, basic can't run that fast :(
-
Here's version 1.1. I finished it a really long time ago, so I've forgotten what's new in this version... Probably just optimizations.
http://www.ticalc.org/archives/files/fileinfo/433/43347.html (http://www.ticalc.org/archives/files/fileinfo/433/43347.html)
-
Here's version 1.1. I finished it a really long time ago, so I've forgotten what's new in this version... Probably just optimizations.
http://www.ticalc.org/archives/files/fileinfo/433/43347.html (http://www.ticalc.org/archives/files/fileinfo/433/43347.html)
Thanks, this is a very cool project. Is there way the analog can move? Not sure if it can be done.
-
Is there way the analog can move? Not sure if it can be done.
What do you mean by that?
-
Is there way the analog can move? Not sure if it can be done.
What do you mean by that?
When I run it, it displays the analog clock, but does it move while the program is running? When I tried V1.0 in my 84+ Keypad, I don't think it did. If you think it does, I'll try again.
-
Is there way the analog can move? Not sure if it can be done.
What do you mean by that?
When I run it, it displays the analog clock, but does it move while the program is running? When I tried V1.0 in my 84+ Keypad, I don't think it did. If you think it does, I'll try again.
The analog clock should change every minute in both 1.0 and 1.1.
-
Is there way the analog can move? Not sure if it can be done.
What do you mean by that?
When I run it, it displays the analog clock, but does it move while the program is running? When I tried V1.0 in my 84+ Keypad, I don't think it did. If you think it does, I'll try again.
The analog clock should change every minute in both 1.0 and 1.1.
I'll try again then.
EDIT: Yes, it works! You just have to wait some time so that you can notice it of course.