0 Members and 3 Guests are viewing this topic.
"49,87,9
"49,87,9,87,159,9,2,2,2,2,1,1,1,1,3,3,3,3,4,4,4,4
ex_helloworld: Delay(30); Text(56,0,"New Program") Key(skprgm) Key(skright) Key(skright) Key(skenter) Key(skpower) ;H Key(sksquared) ;I Key(skminus) ;W Key(sk7) ;O Key(sktimes) ;R Key(skrparen) ;L Key(skinverse) ;D Key(skEnter) Key(skClear) Key(skprgm) Key(skright) Repeat(skdown,7) Key(skEnter) Key(skEnter) Key(skprgm) Key(skright) Repeat(skdown,2) Key(skEnter) Key(sk2nd) Key(skAlpha) Key(skplus) Key(skH-112) Key(skE-112) Key(skL-112) Key(skL-112) Key(skO-112) Key(skSpace-112) Key(skW-112) Key(skO-112) Key(skR-112) Key(skL-112) Key(skD-112) Key(skAlpha) Key(skMath) Repeat(skRight,3) Repeat(skDown,3) Key(skEnter) Key(sk2nd) Key(skMode) Key(skPrgmToken) Key(sk2nd) Key(skAlpha) Key(skpower) ;H Key(sksquared) ;I Key(skminus) ;W Key(sk7) ;O Key(sktimes) ;R Key(skRParen) ;L Key(skinverse) ;D Key(skEnter) ExitTutor()
/=====================\| Key(val) | 1 byte\=====================/ This is the main command. This tells the engine which key tosimulate. For example, to simulate [ENTER], use Key(skEnter)./=====================\| Delay(val) | 2 bytes\=====================/ This sets the delay between simulated key presses. I find 30to work well./=====================\| Text(y,x,string) | 4 bytes + length of string\=====================/ This is how you communicate to the user. This is like theBASIC command, except it draws over whatever is on the LCD, notjust the graph screen. For the worried, this does not affect thecontents of the graph screen. So for example: Text(56,0,"Hello World!")/=====================\| WaitForKey(key) | 2 bytes\=====================/ This waits for the user to press the appropriate key. When theuser presses the key, it will be registered. No other keysrespond while waiting./=====================\| Repeat(key,num) | 3 bytes\=====================/ This will simulate a key press a number of times in a row.This is useful for navigating menus to get to an item./=====================\| ExitTutor() | 1 byte\=====================/ This ends the tutorial and normal OS stuff resumes. These commands should be enough for most tasks. However, ifthere are more commands for the adventurous:/=====================\| SetAns(num) |\=====================/ This will set the "Ans" variable to the specified value. Notethat this whole program works with 1-byte values, 0 to 255./=====================\| TestAnsEqu(num) |\=====================/ If 'Ans' is equal to 'num', then 'Ans' is set to 1, else itis set to 0./=====================\| GetKey(num) |\=====================/ Stores the user's keypress to Ans. This isn't as responsiveas it could be, yet, but it works./=============================\| JumpIfAnsEqu(num,label) | 4 bytes\=============================/ This will jump to a label if Ans=num. Note that the label mustbe on the same flash page./=====================\| PushAns() |\=====================/ This pushes Ans onto a stack for later retrieval withPopAns(). The stack is currently 240 bytes, but it may besmaller in the future./=====================\| PopAns() |\=====================/ This removes the last value on the stack and stores it to'Ans'.
ex_helloworld: Key(skClear) Delay(30) Text(44,0,"First, we need to make") Text(50,0,"a new program. Press PRGM,") Text(56,0,"and the Tutor will do the rest.") WaitForKey(skPRGM) Key(skright) Key(skright) Key(skenter) Text(56,0,"Enter the program name") Key(skpower) ;H Key(sksquared) ;I Key(skminus) ;W Key(sk7) ;O Key(sktimes) ;R Key(skrparen) ;L Key(skinverse) ;D Key(skEnter) Key(skClear) Key(skprgm) Key(skright) Repeat(skdown,7) Key(skEnter) Text(50,0,"Press ENTER to go to the") Text(56,0,"next line of code.") WaitForKey(skEnter) Key(skprgm) Key(skright) Repeat(skdown,2) Key(skEnter) Key(sk2nd) Key(skAlpha) Key(skplus) Key(skH-112) Key(skE-112) Key(skL-112) Key(skL-112) Key(skO-112) Key(skSpace-112) Key(skW-112) Key(skO-112) Key(skR-112) Key(skL-112) Key(skD-112) Key(skAlpha) Key(skMath) Repeat(skRight,3) Repeat(skDown,3) Key(skEnter) Key(sk2nd) Key(skMode) Key(skClear) Text(50,0,"Enter the program name,") Text(56,0,"then press ENTER to run it.") Key(skNULL) Key(skPrgmToken) Key(sk2nd) Key(skAlpha) Key(skpower) ;H Key(sksquared) ;I Key(skminus) ;W Key(sk7) ;O Key(sktimes) ;R Key(skrparen) ;L Key(skinverse) ;D WaitForKey(skEnter) ExitTutor()
MainMenu: Menu("Command Index",cmdindex) Menu("Math Tutorials",mathtutorials) Menu("Programming Tutorials",programming) .db 0programming: Item("Hello World",ex_helloworld,0)cmdindex:mathtutorials: .db 0
MainMenu: Menu(cmdindex) Menu(mathtutorials) Menu(probstattutorials) .db 0cmdindex: .db "Command Index",0 Item(cmd_nCr) .db 0mathtutorials: .db "Math",0 Item(cmd_nCr) .db 0probstatstutorials: .db "Probability/Statistics",0 Item(cmd_nCr) .db 0cmd_nCr: .db "nCr",0 .db tut_nCr