PDA

View Full Version : TI-74 Basic programs?



thumbs
February 17th, 2018, 06:50 AM
I'm not sure if this the proper place to post this, but does anyone have any TI-74 Basic language programs they'd like to share?

Like I've said, I'm no programmer, but I have couple that might be useful. The more I play with the 74, the more I'm fascinated by it. I'm finding more and more reasons to use it; from storing readily available passwords offline to helping me do my bills. Nobody can peek or poke around in this machine or track me while I'm using it. As best I can tell, it's totally secure.

If you do have any programs, just post them here so all can benefit.

The 74 may be old, but it's a great little machine....and puts us completely in charge.

Thanks.

thumbs
February 24th, 2018, 07:39 PM
Like said, I'm no programmer. But here's a program to calculate the gearing of your bicycle in 'gear inches'. (check my math :)

100 PRINT "Gear Inches": PAUSE 1
110 PRINT EQA;"> wheel dia,in. ";: ACCEPT NULL(EQA),EQA
120 PRINT EQB;"> rear tooth #,fw. ";: ACCEPT NULL(EQB),EQB
130 PRINT EQC;"> front tooth #,crank ";: ACCEPT NULL(EQC),EQC
140 EQX=(PI*EQA)/(EQB/EQC): EQY=(EQX/12): EQZ=EQC/EQB*EQA

150 PRINT USING "dist crank rev,in. ###.###";EQX: PAUSE
160 PRINT USING "dist crank rev,ft. ###.###";EQY: PAUSE
170 PRINT USING "wheel dia equiv,in ###.###";EQZ: PAUSE
180 GOTO 100



WHEEL DIAMETER, inches, overall rear rim/tire diameter (26")

REAR TOOTH COUNT, tooth count of desired free wheel/cassette sprocket (34t)

FRONT TOOTH COUNT, tooth count of desired crank sprocket (28t)

DISTANCE, CRANK REVOLUTION, inches, distance bicycle travels in one crank revolution (67.267")

DISTANCE, CRANK REVOLUTION, feet, distance bicycle travels in one crank revolution (5.606')

GEAR INCHES, inches, the gearing effect wheel diameter equivalent in inches (21.412" whl/dia)

JGardner
February 28th, 2018, 07:39 PM
Pretty cool, Thumbs. I've got a bicycle dynamometer program somewhere -

I'll see if I can find it.

Jack

thumbs
March 3rd, 2018, 04:52 AM
I have a difficult time keeping track of passwords. I don't like leaving passwords around on scraps of paper. And I don't leave important information in any device that has access to the outside world. Here's a program that I use on my 74 to keep track of my passwords.


1 Z$="": PRINT "Usernames Passwords": PAUSE 1: GOTO 18000

1000 DATA 1,<retail username password>
1010 DATA ABCD aaaa 1234a5,ABCD bbbb 2345b6
1020 DATA ABCD cccc 3456c7,eof

1100 DATA 2,<automotive username password>
1110 DATA ABCD xxxx 1234x5,ABCD yyyy 2345y6
1120 DATA ABCD zzzz 3456z7,eof


18000 PRINT Z$;" > ";: ACCEPT NULL(Z$),Z$: PRINT ">..";: RESTORE
18005 IF Z$="" THEN Z$="1"
18010 IF Z$="0" THEN PRINT: GOTO 1
18015 READ A$: IF A$=Z$ THEN 18040
18020 IF A$="end" THEN PRINT Z$;" not found": Z$="": PAUSE: GOTO 18000
18030 GOTO 18015
18040 IF A$="eof" THEN PRINT "> end..": PAUSE 1: GOTO 18000
18050 PRINT A$: PAUSE: READ A$: GOTO 18040


32000 DATA eof
32010 DATA end

OS9dude
March 4th, 2018, 08:02 AM
Have not played enough with my TI-74 and I need to!

One of the first things I did when I got it back in Dec '16 was benchmark it calculating the factorial of a given number, the TI-74 fared better than the portable Tandy PC-6 and I made a short video of it -> https://youtu.be/Kv8epjcPcKk

The program is by all means simple and straight forward...

100 ! Factorial
110 INPUT "Number to Factorial? ";N
120 IF N=0 THEN PRINT 0:PAUSE:STOP
130 F=1
140 FOR I=1 TO N
150 F=F*I
160 NEXT I
170 PRINT N;"!=";F=PAUSE
180 END

Completely agree that this portable is a joy to use. As I said, there is a LOT more to do with it. Cheers!

thumbs
March 5th, 2018, 08:52 PM
Here are some miles per gallon programs I use. My old cars only have speedometers in MPH, so the input distances are in miles. I've used the first program when I've traveled through Canada. The second program is more direct using inputs. The third program I use when I have the 74 with me and don't wish to write info on paper. Since the 74 doesn't seem to store program variable info, I enter the variable info directly into the program for storage.

(edited to correct for undesired emojis -- no space in line 2400, RM$="")


2000 PRINT "Gas Mileage":PAUSE 1
2010 PRINT "Clear y-n ";AM$;" ";:ACCEPT NULL(AM$),AM$
2015 PRINT "Fill tank now...":PAUSE
2020 IF AM$="y"THEN 2400
2030 PRINT "Start mileage";BM;:ACCEPT NULL(BM),BM
2040 PRINT "Drive..refilled tank? y-n ";CM$;" ";:ACCEPT NULL(CM$),CMS
2041 IF CM$="y"THEN 2045
2042 PRINT "Drive..then refill tank":PAUSE :GOTO 2040
2045 PRINT "End mileage";DM;:ACCEPT NULL(DM),DM
2050 PRINT "Refill (g)al or (l)iter ";EM$;" ";:ACCEPT NULL(EM$),EM$
2060 IF EM$="g"THEN 2100
2070 IF EM$="l"THEN 2200
2080 PRINT "g or l...":PAUSE :GOTO 2050

2100 PRINT "Gallons added";FM;:ACCEPT NULL(FM),FM
2110 WM=(DM-BM)/FM:XM=((DM-BM)*1.6093472)/FM
2120 YM=(DM-BM)/(FM*3.785332):ZM=((DM-BM)*1.6093472)/(FM*3.785332)
2130 GOTO 2300

2200 PRINT "Liters added";GM;:ACCEPT NULL(GM),GM
2210 WM=(DM-BM)/(GM*.26417):XM=((DM-BM)*1.6093472)/(GM*.26417)
2220 YM=(DM-BM)/GM:ZM=((DM-BM)*1.6093472)/GM
2230 GOTO 2300

2300 PRINT USING"mi/gal ###.##";WM:PAUSE
2305 PRINT USING"km/gal ###.##";XM:PAUSE
2310 PRINT USING"mi/liter ###.##";YM:PAUSE
2315 PRINT USING"km/liter ###.##";ZM:PAUSE
2320 PRINT "Again y-n ";RM$;" ";:ACCEPT NULL(RM$),RM$
2330 IF RM$="y"THEN 2000 ELSE 2300

2400 BM=0:dM=0:WM=0:XM=0:YM=0:ZM=0:FM=0:CM$="":EM$="":RM$="":GOTO 2030


Example:

Clear y-n y
Start mileage 1000
Drive..refilled tank y-n y
End mileage 1100
Refill (g)al or (l)iter g
gallons added 10 (10 gal = 37.85 liter)

mi/gal 10
km/gal 16.09
mi/liter 2.64
km/liter 4.25

.................................................. ....

2000 REM RUN 2000
2010 PRINT "Start miles";START;:INPUT "";START
2020 PRINT "End miles";ENDM;:INPUT "";ENDM
2030 PRINT "Gals added";GALS;:INPUT "";GALS
2040 MPG=(ENDM-START)/GALS
2050 PRINT "MPG =";MPG:PAUSE:GOTO 2010

.................................................. ....

2000 REM RUN 2000
2010 START=1000
2020 ENDM=1100
2030 GALS=10
2040 MPG=(ENDM-START)/GALS
2050 PRINT "MPG =";MPG:PAUSE:END

JGardner
March 8th, 2018, 08:27 AM
Hi Thumbs - It's possible to store data above the high memory pointer

(assuming you have RAM above the high memory pointer), & it will sur-

vive power cycling, & (usually) crashes.

thumbs
March 8th, 2018, 07:51 PM
Thanks Jack.

That's good to know. I'm stilling trying to get deeper into the 74.....it may take a while :)

thumbs
March 27th, 2018, 04:48 PM
My cardiologist said I should lose weight. So, I went online to find information on calories so I could do something on my TI-74. I found this website,

http://www.seacoastonline.com/article/20070412/ENTERTAIN/704120346

Read their website for more details and complete information. They have information on maintaining calories. If I understand it correctly, anything over your desired weight maintaining calories, you gain weight and anything under you lose weight. Below are several routines I made using their math and examples. The routines seem to yield the example results they gave. I'm no programmer or dietition, so double check any results.

The first two routines are short and direct. The third is more descriptive.


20000 REM (for men) AL=activity level 1.2 1.375 1.55 1.725 1.9
20010 LBS=175:HTIN=72:AGE=30:AL=1.55
20020 PRINT "INT((66+(6.23*LBS)+(12.7*HTIN)-(6.8*AGE))*AL)":PAUSE:END


To use the above routine (for men), seed the variables on line 20010; LBS=desired weight in pounds, HTIN=height in inches, AGE=age in years, AL=activity level, sedentary 1.2 to extra active 1.9

Then, RUN 20000, press [ENTER], press [SHIFT] [PB] [ENTER] for maintaining calories (2893).

Do similar to use the (for women) routine below.


20100 REM (for women) AL=activity level 1.2 1.375 1.55 1.725 1.9
20110 LBS=140:HTIN=66:AGE=30:AL=1.55
20120 PRINT "INT((655+(4.35*LBS)+(4.7*HTIN)-(4.7*AGE))*AL)":PAUSE:END

..............................


For a more menu driven routine, type in the routine below and RUN 20500.

20500 PRINT "Maintain Calories":PAUSE 1
20505 PRINT MW$;" (m)an or (w)oman ";:ACCEPT NULL(MW$),MW$
20510 PRINT LBS;"desired lbs ";:ACCEPT NULL(LBS),LBS
20520 PRINT HTIN;"height inches ";:ACCEPT NULL(HTIN),HTIN
20530 PRINT AGE;"age ";:ACCEPT NULL(AGE),AGE
20540 PRINT "1=sedentary 2=lightly active":PAUSE
20550 PRINT "3=moderately 4=very active":PAUSE
20560 PRINT "5=extra active":PAUSE
20570 PRINT AL$;" activity level 1-5 ";:ACCEPT NULL(AL$),AL$
20580 IF AL$="1"THEN AL=1.2:GOTO 20640
20590 IF AL$="2"THEN AL=1.375:GOTO 20640
20600 IF AL$="3"THEN AL=1.55:GOTO 20640
20610 IF AL$="4"THEN AL=1.725:GOTO 20640
20620 IF AL$="5"THEN AL=1.9:GOTO 20640
20630 PRINT "error..1-5":PAUSE:GOTO 20540
20640 IF MW$="m"THEN 20670
20650 IF MW$="w"THEN 20690
20660 PRINT "error..m w":PAUSE:GOTO 20505

20670 SCM=(66+(6.23*LBS)+(12.7*HTIN)-(6.8*AGE))*AL
20680 PRINT "Maintain calories";INT(SCM);"@";LBS:PAUSE:GOTO 20500

20690 SCW=(655+(4.35*LBS)+(4.7*HTIN)-(4.7*AGE))*AL
20700 PRINT "Maintain calories";INT(SCW);"@";LBS:PAUSE:GOTO 20500


Examples for 20500 routine:

Man, LBS=175 HTIN=72 AGE=30 AL=3, Maintain calories=2893

Woman, LBS=140 HTIN=66 AGE=30 AL=3, Maintain calories=2221

thumbs
April 5th, 2018, 12:11 PM
I was helping my grandson rebuild his air-cooled VW Beetle engine. He needed to determine his compression ratio for each cylinder. We went online and found compression ratio calculators. Most were for engines with head gaskets and possibly dome/dished pistons which he has neither. He has 87mm cylinders with flat pistons, no head gasket, and a 69mm stroke. I made this program for the TI-74 a little more specific to his situation. For comparison, we used this websites calculator,

http://www.csgnetwork.com/compcalc.html

If we entered the head gasket bore diameter as, 0 and the head gasket thickness as, 0 and dome/dished piston volume as, 0 with a deck height of 1.5mm it yielded, 7.962 to 1 Comp/Ratio with total displacement volume of 58.917cc (that's his combustion chamber 50cc + his deck height displacement of 8.917cc)

It looks like the TI-74 is yielding similar results as the online calculator. Like I've said before, I'm no programmer or engineer, so check over the results for yourself. At any rate, he used the 74 to determine his compression ratio as it was easier to use.


4000 PRINT "Comp/Ratio Air-cooled VW":PAUSE 1
4010 PRINT BMM;" bore,mm ";:ACCEPT NULL(BMM),BMM
4020 PRINT SMM;" stroke,mm ";:ACCEPT NULL(SMM),SMM
4030 PRINT DMM;" deck height,mm ";:ACCEPT NULL(DMM),DMM
4040 PRINT HCC;" comb chamber vol,cc ";:ACCEPT NULL(HCC),HCC
4050 CYLD=BMM^2*SMM*.0031416/4
4060 DHDP=BMM^2*DMM*.0031416/4
4070 COMR=(CYLD+DHDP+HCC)/(DHDP+HCC)

4080 PRINT USING"Compression Ratio ##.###";COMR;:PRINT " to 1":PAUSE
4090 PRINT USING"Deck Height Disp,cc ##.###";DHDP:PAUSE
4100 GOTO 4000


Example:

BORE=87mm
STROKE=69mm
DECK HEIGHT=1.5mm
COMBUSTION CHAMBER VOLUME,cc=50cc

COMPRESSION RATIO to 1= 7.962
DECK HEIGHT DISPLACEMENT,cc= 8.917

thumbs
April 21st, 2018, 07:17 PM
I'm not sure if this will make sense to anyone else, but this helps me pay my bills. I admit my monthly bills are quite simple. CK in line 1 is my current checking account balance. DATE$ is for date or indentity. NOTE$ is for a short note or reminder. The values in line 100 to 195 are the stored current bill identities and values. Change or expand the programs bill identities and values as needed (these are ficticious values). Enter 0 for no bill value.

Since the TI-74 doesn't retain variables when turned off, I'm storing the initial bill values in DATA statements. CK will load in from the program at the beginning; alter CK thereafter if desired. All of the bill values must be entered in by hand. When a bill value is present as a left side value, enter it. After that, alter any value to see how the (exp) expense total and the (nw.acc.bal) new checking account balance changes. The left figure is from the DATA statements, the center figure is the entered in value and the right figure is the tally. I suppose I could tally the bills in one line on the display directly but this has a little more discription. It isn't great but it helps me even-out my flexible payment bills on my fixed monthly income.


1 CK=2000:dATE$="Bills: apr2 2018": GOTO 100
2 REM 4-18-18

100 DATA house,300.50
110 DATA card1,50.75
120 DATA card2,60.55
125 DATA card3,70.25
130 DATA phone,90.65
140 DATA elec,80.75
150 DATA n-gas,70.40
160 DATA ins1,87.35
170 DATA ins2,75.80
175 DATA ins3,63.25
180 DATA misc1,12.20
185 DATA misc2,40.60
190 DATA misc3,23.80,eof

195 NOTE$="none"


200 PRINT DATE$:PAUSE
203 PRINT CK;"ck.acc.bal > ";:ACCEPT NULL(CK),CK
204 IF CK=0 THEN 1

205 READ R$:T$=R$:IF R$="house"THEN READ R$ ELSE 205
210 PRINT T$;" ";R$;HS;TAL;"> ";:ACCEPT NULL(HS),HS:TAL=TAL+HS

220 READ R$:T$=R$:IF R$="card1"THEN READ R$ ELSE 220
230 PRINT T$;" ";R$;C1;TAL;"> ";:ACCEPT NULL(C1),C1:TAL=TAL+C1

240 READ R$:T$=R$:IF R$="card2"THEN READ R$ ELSE 240
250 PRINT T$;" ";R$;C2;TAL;"> ";:ACCEPT NULL(C2),C2:TAL=TAL+C2

252 READ R$:T$=R$:IF R$="card3"THEN READ R$ ELSE 252
254 PRINT T$;" ";R$;C3;TAL;"> ";:ACCEPT NULL(C3),C3:TAL=TAL+C3

260 READ R$:T$=R$:IF R$="phone"THEN READ R$ ELSE 260
270 PRINT T$;" ";R$;PH;TAL;"> ";:ACCEPT NULL(PH),PH:TAL=TAL+PH

280 READ R$:T$=R$:IF R$="elec"THEN READ R$ ELSE 280
290 PRINT T$;" ";R$;EL;TAL;"> ";:ACCEPT NULL(EL),EL:TAL=TAL+EL

300 READ R$:T$=R$:IF R$="n-gas"THEN READ R$ ELSE 300
310 PRINT T$;" ";R$;GS;TAL;"> ";:ACCEPT NULL(GS),GS:TAL=TAL+GS

320 READ R$:T$=R$:IF R$="ins1"THEN READ R$ ELSE 320
330 PRINT T$;" ";R$;I1;TAL;"> ";:ACCEPT NULL(I1),I1:TAL=TAL+I1

340 READ R$:T$=R$:IF R$="ins2"THEN READ R$ ELSE 340
350 PRINT T$;" ";R$;I2;TAL;"> ";:ACCEPT NULL(I2),I2:TAL=TAL+I2

352 READ R$:T$=R$:IF R$="ins3"THEN READ R$ ELSE 352
354 PRINT T$;" ";R$;I3;TAL;"> ";:ACCEPT NULL(I3),I3:TAL=TAL+I3

360 READ R$:T$=R$:IF R$="misc1"THEN READ R$ ELSE 360
370 PRINT T$;" ";R$;M1;TAL;"> ";:ACCEPT NULL(M1),M1:TAL=TAL+M1

380 READ R$:T$=R$:IF R$="misc2"THEN READ R$ ELSE 380
390 PRINT T$;" ";R$;M2;TAL;"> ";:ACCEPT NULL(M2),M2:TAL=TAL+M2

392 READ R$:T$=R$:IF R$="misc3"THEN READ R$ ELSE 392
394 PRINT T$;" ";R$;M3;TAL;"> ";:ACCEPT NULL(M3),M3:TAL=TAL+M3

395 PRINT "note..none";NOTE$:PAUSE

400 NCK=CK-TAL
410 PRINT "exp";TAL;" nw.acc.bal";NCK:PAUSE
420 TAL=0:RESTORE:GOTO 200


Example:

CK=2000

house=300.50
card1=50.75
card2=60.55
card3=70.25
phone=90.65
elec=80.75
n-gas=70.40
ins1=87.35
ins2=75.80
ins3=63.25
misc1=12.20
misc2=40.60
misc3=23.80

NOTE$="none"


note..none
exp 1026.85
nw.acc.bal 973.15

thumbs
May 12th, 2018, 09:53 PM
I made this small RPN style calculator mainly to work on my old car's suspension using a polar to rectangular(pr) and a rectangular to polar(rp) routine in Basic. I find it helpful to roll over or alter previous inputs. Using the TI-74 in calculator mode I used the (x,y) key then P>R and R>P to check RPN Calc's operation. It seems to be working okay, showing similar results as the 74 calculator mode. Check out RPN Calc thoroughly to see if it's working properly before using it. All angles are in degrees decimal. Answers with ">" direction indicator (use CTL 4 arrow if desired), uses the "space bar" to bring the answer to 1) input. Use "shift #" to clear or "0" to end. For 'pr' enter radius first then angle. For 'rp' enter x first then y.



16000 PRINT "RPN Calc ":PAUSE 1
16001 C=0:Z$="?":d=0:dEG
16002 PRINT "1)";C;": ";:ACCEPT NULL(C),C
16010 PRINT "2)";D;": ";:ACCEPT NULL(D),D
16012 PRINT Z$;") + - * / ^ rt pr rp ";:ACCEPT NULL(Z$),Z$
16015 IF Z$="0"THEN END
16020 IF Z$="+"THEN A=C+D:GOTO 16080
16030 IF Z$="-"THEN A=C-D:GOTO 16080
16040 IF Z$="*"THEN A=C*D:GOTO 16080
16050 IF Z$="/"THEN A=C/D:GOTO 16080
16060 IF Z$="^"THEN A=C^D:GOTO 16080
16070 IF Z$="rt"THEN A=C^(1/D):GOTO 16080
16072 IF Z$="pr"THEN Y=C*SIN(D):X=C*COS(D):GOTO 16100
16073 IF Z$="rp"THEN R=SQR(C^2+D^2):A=ASIN(D/R):GOTO 16110
16078 PRINT ">..error":PAUSE:GOTO 16002

16080 ANS=A:PRINT "ans=";A;":";C;Z$;D;:PAUSE
16090 PRINT ">":A$=KEY$:IF A$="#"THEN 16001
16092 IF A$=" "THEN C=A:GOTO 16002
16093 IF A$="0"THEN END
16095 GOTO 16002

16100 PRINT "x=";X;"y=";Y:PAUSE:GOTO 16002

16110 IF C<0 AND D>0 THEN A=ABS(180-A)
16112 IF C<0 AND D<0 THEN A=ABS(180-A)-360
16120 PRINT "r=";R;CHR$(242);"a=";A:PAUSE:GOTO 16002


Examples:

1) 1728, 2) 3, rt = 12
1) 100, 2) 40, pr =, x=76.60444431, y=64.27876097
1) 145, 2) 23, rp =, r=146.812806, a=9.013204356

thumbs
July 11th, 2018, 06:15 AM
Recently I decided to build a small stationary steam engine for entertainment. Not being a professional machinist or engineer, I needed to figure out how to determine and make a small eccentric cam for the valve. I came up with this program for the TI-74. I made a diagram of a cams dimensional values below using text and characters. The diagram and its proportions aren't too pretty but it should give some idea of what I thought was a way to determine an eccentric cams stroke and demensions.



3000 REM RUN 3000
3005 PRINT "Eccentric Cam":PAUSE 1
3010 PRINT ECM;" o/a stroke,in. ";: ACCEPT NULL(ECM),ECM
3020 PRINT DCM;" shaft dia,in. ";: ACCEPT NULL(DCM),DCM
3030 PRINT BCM;" small offset (B),in. ";: ACCEPT NULL(BCM),BCM
3040 ACM=ECM+BCM:CCM=ACM+BCM+DCM:RCM=CCM/2
3050 PRINT "Large offset (A),in.";ACM:PAUSE
3060 PRINT "Cam dia,in.";CCM:PAUSE
3070 PRINT "Cam radius,in.";RCM:PAUSE:GOTO 3005


Example:

overall stroke desired 1.312"
driving shaft diameter .5"
small offset (B) .125"

Large offset (A)= 1.437"
Cam diameter= 2.062"
Cam radius= 1.031"


Cam dia. 2.062"
|<------------>|
| |
*
* *
/ \
1.031" <Rad>+ (+) (overall stroke 1.312")
shaft dia. .5" --------\--- --->| | /
| * | | |
| *
| | | |
1.437" Large offset |< -A- > | | |
| |
| |
B-->| |<--small offset .125



(the text diagram I made won't post properly....sorry, the best I can do)

JGardner
July 11th, 2018, 02:28 PM
Steam engines are a lot of fun - Here's the dynamometer pgm

I mentioned awhile back - Nothing special, but might be useful...

http://ftp.whtech.com/hexbus_cc40_ti74/Software%20in%20PCIF%20format/dyno2.txt

Jack

I should mention that the "Deceleration" term is an attempt to model

the real-world behavior of a bicycle - At low speeds, where the inverse-

square nature of aerodynamic drag is not yet the dominant factor.

thumbs
July 30th, 2018, 08:07 PM
*****

thumbs
October 30th, 2018, 05:02 PM
Unit-Unit, 10-30-18

I'm not very good at math. Every now and then I play with electronics. Here's a program I wrote for the TI-74 that converts the value from one unit to another. The conversion range is what I use most.

Here's a unit converter I found on line that could be used in place of or used to confirm the TI-74's results. If you type in the TI-74 program check to make sure it's working properly.

https://www.translatorscafe.com/unit-converter/en/prefixes/15-14/micro-milli/
...................

p=pico
n=nano
m=micro
ml=milli
u=unit
k=kilo
mg=mega
g=giga


6000 PRINT "Unit-Unit":PAUSE 1
6005 INPUT "Value ";C9," p,n,m,ml,k,mg,g ";Z$," p n m ml u k mg g ";X$

6010 W9=0:A=0:IF Z$="p"THEN W9=C9*10^-12
6020 IF Z$="n"THEN W9=C9*10^-9
6030 IF Z$="m"THEN W9=C9*10^-6
6040 IF Z$="ml"THEN W9=C9*.001
6050 IF Z$="k"THEN W9=C9*1000
6060 IF Z$="mg"THEN W9=C9*10^6
6070 IF Z$="g"THEN W9=C9*10^9

6090 IF X$="p"THEN A=W9*10^12
6100 IF X$="n"THEN A=W9*10^9
6110 IF X$="m"THEN A=W9*10^6
6120 IF X$="ml"THEN A=W9*1000
6130 IF X$="k"THEN A=W9*.001
6140 IF X$="mg"THEN A=W9*10^-6
6150 IF X$="g"THEN A=W9*10^-9
6160 IF X$="u"THEN A=W9:X$="u"

6170 IF W9=0 OR A=0 THEN PRINT"error..":PAUSE:GOTO 6005
6180 PRINT C9;Z$;" =";A;X$:PAUSE:GOTO 6005


Example: Value = 155

155 (ml)milli-sec is how many (m)micro-sec ?

155 (ml)milli-sec = 155000 (m)micro-sec

thumbs
November 10th, 2018, 07:07 PM
Drive Ratio, 11-10-18

My grandson was setting up his drive train on his air-cooled VW Bug. Since his cooling is tied to engine rpm/fan he wanted to know what his setup would be doing. I made this program for the TI-74 to help him determine what he had. Hope I did it right :)

Here's an online calculator that gives similar mph results,

https://spicerparts.com/calculators/transmission-ratio-rpm-calculator


5000 PRINT "Drive Ratio":PAUSE 1
5005 IMAGE #####.##
5010 PRINT AA;"> r&p ratio to 1 ";:ACCEPT NULL(AA),AA
5020 PRINT BB;"> Xth gear ratio to 1 ";:ACCEPT NULL(BB),BB
5030 PRINT CC;"> engine stroke,in. ";:ACCEPT NULL(CC),CC
5040 PRINT DD;"> engine rpm ";:ACCEPT NULL(DD),DD
5050 PRINT EE;"> tire dia,in. ";:ACCEPT NULL(EE),EE

5100 XX=AA*BB
5110 YY=DD*EE/(XX*336)
5120 ZZ=CC*2*DD/12

5130 PRINT "Drive ratio,? to 1=";:PRINT USING 5005;XX:PAUSE
5140 PRINT "Vehicle speed,mph=";:PRINT USING 5005;YY:PAUSE
5150 PRINT "Piston speed,ft/min=";:PRINT USING 5005;ZZ:PAUSE
5160 GOTO 5000


Example:

r&p ratio to 1, 4.125
Xth gear ratio to 1, .89 (4th)
engine stroke,in. 2.717"
engine rpm, 3500
tire dia,in. 24.5"

Drive ratio,? to 1= 3.67
Vehicle speed,mph= 69.52
Piston speed,ft/min= 1584.92



ring & pinion ratio, ? to 1
Xth gear ratio, ? to 1, refers to 1st, 2nd, 3rd, etc... gear ratio
engine stroke, inches
engine rpm, rev/min
tire diameter, mounted tire overall diameter, inches

Drive ratio, final drive ratio (r&p + gear), ? to 1
Vehicle speed, mph
Piston speed, feet/minute (4000 ft/min max)

Caleb Hansberry
November 21st, 2018, 08:48 PM
Thanks for posting these programs here! I love programmable calculators.

thumbs
November 28th, 2018, 08:12 PM
Bin Dec Hex, 11-28-18


I was given an old Tandy Color Computer. While playing around with it I decided I needed something to convert from binary to decimal to hex. I found these bin-dec-hex converters online.....

https://www.binaryhexconverter.com/

They work great but I wanted something that was a little easier and would roll between binary, decimal and hex. So, I wrote this program for my TI-74. It will only do decimal to 1048575, hex to FFFFF and binary a little larger. I confirmed the output with the online converters above and it seems to give similar results. Like I say, I'm no programmer or math expert so if you type it in make sure it's working okay.



9000 PRINT "Bin Dec Hex":PAUSE .8
9002 T8$=Z8$:PRINT Z8$;" bin ";:ACCEPT NULL(Z8$),Z8$
9005 J8=0:A8=0:I8=LEN(Z8$):IF Z8$=""THEN 9000
9010 C8=VAL(SEG$(Z8$,I8,1)):A8=A8+INT(C8*2^J8 ):J8=J8+1:I8=I8-1
9015 IF C8>1 OR C8<0 THEN PRINT "..not binary":PAUSE:Z8$=T8$:GOTO 9000
9020 IF I8=0 THEN PRINT "Dec=";A8:PAUSE:GOTO 9500
9030 GOTO 9010

9500 PRINT A8;"dec ";:ACCEPT NULL(A8 ),A8
9502 IF A8<0 THEN PRINT "..pos # only":PAUSE:GOTO 9500
9505 A9=A8:IF A8>1048575 THEN PRINT "..dec 1048575 max":PAUSE:GOTO 9500
9510 B9=A8/16^4:K9=INT(B9):A8=B9-INT(B9):B9=(A8*16^4)/16^3:C9=INT(B9)
9520 A8=B9-INT(B9):B9=(A8*16^3)/16^2:W9=INT(B9):A8=B9-INT(B9):B9=(A8*16^2)/16
9530 I9=INT(B9):A8=B9-INT(B9):J9=INT(A8*16.001)
9540 A9$="":CC=K9:GOSUB 9600:CC=C9:GOSUB 9600:CC=W9:GOSUB 9600
9550 CC=I9:GOSUB 9600:CC=J9:GOSUB 9600
9560 PRINT "Hex= ";A9$:PAUSE:GOSUB 9800
9570 IF F9$=""THEN PRINT "..not hex":PAUSE:GOTO 9560
9580 GOTO 9000

9600 IF CC=10 THEN A9$=A9$&"A"
9610 IF CC=11 THEN A9$=A9$&"B"
9620 IF CC=12 THEN A9$=A9$&"C"
9630 IF CC=13 THEN A9$=A9$&"D"
9640 IF CC=14 THEN A9$=A9$&"E"
9650 IF CC=15 THEN A9$=A9$&"F"
9660 IF CC<10 THEN A9$=A9$&STR$(CC)
9670 RETURN

9800 H9$=A9$:F9$="":CT=0
9805 PRINT H9$;" hex ";:ACCEPT VALIDATE(UALPHANUM)NULL(H9$),H9$
9810 CT=CT+1:G9$=SEG$(H9$,CT,1)
9820 IF CT<6 THEN GOSUB 9900 ELSE Z8$=F9$:RETURN
9830 GOTO 9810

9900 IF G9$="F"THEN F9$=F9$&"1111"
9910 IF G9$="E"THEN F9$=F9$&"1110"
9915 IF G9$="D"THEN F9$=F9$&"1101"
9920 IF G9$="C"THEN F9$=F9$&"1100"
9925 IF G9$="B"THEN F9$=F9$&"1011"
9930 IF G9$="A"THEN F9$=F9$&"1010"
9935 IF G9$="9"THEN F9$=F9$&"1001"
9940 IF G9$="8"THEN F9$=F9$&"1000"
9945 IF G9$="7"THEN F9$=F9$&"0111"
9950 IF G9$="6"THEN F9$=F9$&"0110"
9955 IF G9$="5"THEN F9$=F9$&"0101"
9960 IF G9$="4"THEN F9$=F9$&"0100"
9965 IF G9$="3"THEN F9$=F9$&"0011"
9970 IF G9$="2"THEN F9$=F9$&"0010"
9975 IF G9$="1"THEN F9$=F9$&"0001"
9980 IF G9$="0"THEN F9$=F9$&"0000"
9985 RETURN



Example:

bin 11111111111111111111 [enter]
Dec= 1048575 [enter]
1048575 dec 49152 [enter]
Hex= 0C000 [enter]
0C000 hex 0FAE2 [enter]

00001111101011100010 bin [enter]
Dec= 64226 [enter]
64226 dec [enter]
Hex= 0FAE2 [enter]
0FAE2 hex [enter]

thumbs
December 15th, 2018, 07:16 AM
On the Dec Bin Hex program I found an error today. (I can only edit up to 15 mins after I post). Line 9820 reads:

9820 IF CT<6 THEN GOSUB 9900 ELSE Z8$=F9$:RETURN

It should be:

9820 IF CT<6 THEN GOSUB 9900 ELSE Z8$=F9$:GOTO 9000

JGardner
December 16th, 2018, 11:53 AM
Speaking of spaghetti code... "8)

Just kidding - BASIC limits choice in this regard.

Although it can be done...

thumbs
January 4th, 2019, 08:39 PM
Conversions, 1-4-19

I thought it would be nice to have a package of my own frequently used conversions. The layout 'mi>km', miles to kilometers, made sense to me. The number 1.6093 multiplied by miles should yield kilometers. Enter your own conversions and multiplier beginning at 7000 in the DATA statements. I included some conversions I frequently use. Use multipliers with more digits for more accurate results.

For conversions using a formula like 'f>c', fahrenheit to celsius, enter the conversion then a -1 for the number multiplier. This will send the program to the 7900s where you can work the equation. Follow the programming example that's there. Keep all conversions with a number multiplier between 7000 and 7399 (above the -1s).

The 'ans' variable on the display will contain the answer. You can use it to seed another input. If you type the program in, make sure it's all working properly. On line 7490 make sure you type 'end..,..' (end, two periods, comma, two periods).

Entering 'conv' for a conversion will list the conversions. Entering 'conv#' will list the conversions plus the conversion multiplier. Compare all conversions to known results before using.

(I'm no programmer but if you have the red sauce I have the code :)




7000 DATA mi>km,1.6093,km>mi,0.6214
7010 DATA yd>m,0.9144,m>yd,1.0936
7020 DATA ft>m,0.3048,m>ft,3.2808

7030 DATA in>mm,25.4,mm>in,0.03937
7040 DATA in>cm,2.54,cm>in,0.3937
7050 DATA in>m,0.0254,m>in,39.37

7060 DATA in2>mm2,645.16,mm2>in2,0.00155
7070 DATA in2>cm2,6.4516,cm2>in2,0.155
7080 DATA ft2>m2,0.0929,m2>ft2,10.764

7090 DATA in3>cm3,16.387,cm3>in3,0.06102
7100 DATA gal>ltr,3.7854,ltr>gal,0.26417
7110 DATA in3>gal,0.004329,gal>in3,231

7120 DATA in3>ltr,0.01639,ltr>in3,61.023
7130 DATA gal>cm3,3785.4,cm3>gal,0.000264
7140 DATA lbs>kgs,0.4536,kgs>lbs,2.2046

7150 DATA mph>ft/s,1.46667,ft/s>mph,0.6818166322


7400 REM only -1s below
7405 DATA f>c,-1,c>f,-1

7490 DATA end..,..


7500 PRINT "Conversion":PAUSE .8:A9$="":B9=0:RESTORE 7000
7510 PRINT Z9$;" conv ";:ACCEPT NULL(Z9$),Z9$
7512 IF Z9$="conv"OR Z9$="conv#"THEN C9=0:GOTO 7800
7518 PRINT C9;"num ";:ACCEPT NULL(C9),C9
7520 READ A9$,B9
7525 IF B9=-1THEN 7900
7530 IF A9$=Z9$THEN 7570
7540 IF A9$="end.."THEN PRINT Z9$;" not found":Z9$="":PAUSE:GOTO 7500
7550 GOTO 7520

7570 ANS=C9*B9
7580 PRINT "ans";C9;A9$;" =";ANS:PAUSE:GOTO 7500

7800 RESTORE 7000
7810 READ A9$,B9$:IF Z9$="conv"THEN PRINT A9$:PAUSE
7815 IF Z9$="conv#"THEN PRINT A9$;" ";B9$:PAUSE
7820 IF A9$="end.."THEN 7500 ELSE 7810
7830 GOTO 7500

7900 IF Z9$="c>f"THEN ANS=(C9*(9/5))+32:A9$=Z9$:GOTO 7580
7910 IF Z9$="f>c"THEN ANS=(C9-32)*(5/9):A9$=Z9$:GOTO 7580

7990 A9$="end..":GOTO 7540



Example:

conv lbs>kgs [enter]
0 num 210 [enter]
ans 210 lbs>kgs = 95.256

[enter]
lbs>kgs conv [enter]
210 num 300 [enter]
ans 300 lbs>kgs = 136.08

[enter]
lbs>kgs conv kgs>lbs [enter]
300 num 136.08 [enter]
ans 136.08 kgs>lbs = 300.001968

thumbs
January 25th, 2019, 04:45 AM
Wind Chill, 1-25-19

Sometimes the weather report doesn't give the wind chill. Sometimes my local weather conditions differ from the weather report. When it's really cold outside I like to know the wind chill. I went online and found math for wind chill and made this for the TI-74. It seems to yield similar results as weather forecasts. Check it out.




600 PRINT "Wind Chill":PAUSE .6
610 PRINT TEMP;"temp,deg f ";:ACCEPT NULL(TEMP),TEMP
620 PRINT WSPED;"wind speed,mph ";:ACCEPT NULL(WSPED),WSPED
630 WCHIL=35.74+(.6215*TEMP)-(35.75*WSPED^.16)+(.4275*TEMP*WSPED^.16)
640 ANS=WCHIL:PRINT USING"ans wind chill,deg f=###.#";WCHIL:PAUSE:GOTO 600



Example:

0 temp,deg f -5 [enter]
0 wind speed,mph 13 [enter]
ans wind chill,deg f=-24.5

-5 temp,deg f 13 [enter]
13 wind speed,mph 5 [enter]
ans wind chill,degf= 4.8

Bentendo64
January 29th, 2019, 09:00 AM
A few years ago, I wrote a crappy program to calculate prime numbers. Every once in a while, at social gatherings, I'd pull out the TI-74 and announce that whatever number on the screen is a prime number.

thumbs
March 2nd, 2019, 05:23 AM
Simpson's Rule, 3-2-19

I found this website that calculated the volume of an American football with a definite integral.

https://www.math.ucdavis.edu/~morris/16B/sec5.7.pdf

As I've said before, I'm no programmer and I'm poor at math. But I wanted to see if I could work a definite integral on my TI-74. I found Simpson's Rule which is supposed to work a definite integral. I programmed Simpson's Rule on my 74. I put the definite integral on line 8100. It seems to work okay....at least it gave the results of their football example.




8000 PRINT "Simpson's Rule":PAUSE 1:Z=0:V=1:Y=0
8005 PRINT "Def.Integral..line 8100":PAUSE 1
8010 PRINT A;"start ";:ACCEPT NULL(A),A
8020 PRINT B;"end ";:ACCEPT NULL(B),B
8030 PRINT C;"step ";:ACCEPT NULL(C),C
8040 D=(B-A)/C:X=A-D
8045 IF (C/2)-INT(C/2)>0 THEN PRINT "..step even #s only":PAUSE :GOTO 8030
8050 X=X+D:IF X>B THEN 8130
8060 IF X=B THEN V=1
8070 IF V=1 THEN 8100
8080 IF V=2 THEN V=4:GOTO 8100
8090 IF V=4 THEN V=2

8100 Y=((-.0944*X^2)+3.4)^2*PI

8105 PRINT "x=";X;" y=";Y
8110 Y=Y*V:IF V=1 THEN V=2
8120 Z=Z+Y:GOTO 8050
8130 F=(Z*D)/3
8140 ANS=F:PRINT "ans=";F:PAUSE:GOTO 8000



Football example:

0 start -5.5 [enter]
0 end 5.5 [enter]
0 step 20 [enter]

ans= 232.1679769 in3 - football volume (cubic inches)

(delete line 8105 if you don't want to see X and Y on the display)

curtis
March 2nd, 2019, 06:14 AM
Of course that's assuming it's not the New England Patriots footballs!



Simpson's Rule, 3-2-19

I found this website that calculated the volume of an American football with a definite integral.

https://www.math.ucdavis.edu/~morris/16B/sec5.7.pdf

As I've said before, I'm no programmer and I'm poor at math. But I wanted to see if I could work a definite integral on my TI-74. I found Simpson's Rule which is supposed to work a definite integral. I programmed Simpson's Rule on my 74. I put the definite integral on line 8100. It seems to work okay....at least it gave the results of their football example.




8000 PRINT "Simpson's Rule":PAUSE 1:Z=0:V=1:Y=0
8005 PRINT "Def.Integral..line 8100":PAUSE 1
8010 PRINT A;"start ";:ACCEPT NULL(A),A
8020 PRINT B;"end ";:ACCEPT NULL(B),B
8030 PRINT C;"step ";:ACCEPT NULL(C),C
8040 D=(B-A)/C:X=A-D
8045 IF (C/2)-INT(C/2)>0 THEN PRINT "..step even #s only":PAUSE :GOTO 8030
8050 X=X+D:IF X>B THEN 8130
8060 IF X=B THEN V=1
8070 IF V=1 THEN 8100
8080 IF V=2 THEN V=4:GOTO 8100
8090 IF V=4 THEN V=2

8100 Y=((-.0944*X^2)+3.4)^2*PI

8105 PRINT "x=";X;" y=";Y
8110 Y=Y*V:IF V=1 THEN V=2
8120 Z=Z+Y:GOTO 8050
8130 F=(Z*D)/3
8140 ANS=F:PRINT "ans=";F:PAUSE:GOTO 8000



Football example:

0 start -5.5 [enter]
0 end 5.5 [enter]
0 step 20 [enter]

ans= 232.1679769 in3 - football volume (cubic inches)

(delete line 8105 if you don't want to see X and Y on the display)

thumbs
April 3rd, 2019, 06:29 AM
Calories Burned Cycling, 4-3-19

Now that the weather's warmer, I'm back on my bicycle. If I didn't ride my bicycle I'd probably not excercise at all. I vary my ride frequently and often wonder how many calories a given ride burns. I found this Calories Burned Cycling calculator online:

https://captaincalculator.com/health/calorie/calories-burned-cycling-calculator/

It seems to work good. I decided to write a program for my Ti-74 using their math and info. The Ti-74 yields results pretty close to the example given. Checkout the website for more detailed information with an explanation and examples of MET. I did include some of their MET values I thought were pertinent.




1400 DATA met number is the..
1402 DATA metabolic equivalent of task
1405 DATA leisure 5.5 mph = 3.5 met
1410 DATA leisure 9.4 mph = 5.8 met
1420 DATA bicycling general = 7.5 met
1430 DATA mountain general = 8.5 met
1440 DATA fast 14-15.9 mph = 10 met
1450 DATA racing 16-19 mph = 12 met
1490 DATA end

1500 PRINT "Calories Burned Cycling":PAUSE .8:A7$="":RESTORE 1400
1510 PRINT W;"your weight ";:ACCEPT NULL(W),W
1520 PRINT CW$;" (l)bs or (k)gs ";:ACCEPT NULL(CW$),CW$
1530 IF CW$="l"THEN WT=W*0.45359237:GOTO 1560
1540 IF CW$="k"THEN 1560
1550 GOTO 1520

1560 PRINT MT$;" (m)et or (v)iew ";:ACCEPT NULL(MT$),MT$
1570 IF MT$="v"THEN 1600 ELSE 1590
1580 GOTO 1560
1590 PRINT MET;"met ";:ACCEPT NULL(MET),MET:GOTO 1630

1600 READ A7$
1610 IF A7$="end"THEN RESTORE 1400:GOTO 1560
1615 PRINT A7$:PAUSE
1620 GOTO 1600

1630 PRINT MIN;"ride mins ";:ACCEPT NULL(MIN),MIN
1640 ANS=((MET*WT*3.5)/200)*MIN
1650 PRINT USING"ans calories burned ####.#";ANS:PAUSE:GOTO 1500



Example:

0 your weight 160 [enter]
(l)bs or (k)gs l [enter] -- pounds or kilograms
(m)et or (v)iew m [enter] -- to enter or view met value
0 met 5.8 [enter] -- met number from list
0 ride mins 80 [enter] -- total minutes of bike ride

ans calories burned 589.3


160 your weight 72.72 [enter]
l (l)bs or (k)gs k [enter]
m (m)et or (v)iew [enter]
5.8 met [enter]
80 ride mins [enter]

ans calories burned 589.3

thumbs
April 3rd, 2019, 09:49 PM
Calories Burned Cycling, corrections, 4-4-19

I found some errors. Change:

1540 IF CW$="k"THEN WT=W:GOTO 1560

1570 IF MT$="v"THEN 1600
1575 IF MT$="m"THEN 1590

The Kgs example result: 590.5

If I find anymore, I'll let you know. Like I've said, I'm no programmer.