Coding for Good:
TI-84 Plus family
of graphing calculators
Choose your level — and let’s start coding to earn the Coding for Good, Badge 1: Coding Basics
Junior: Coding for Good, Badge 1 >>
Introduction
The programming language BASIC (stands for Beginner’s All-purpose Symbolic Instruction Code) was developed in the 1960s as an easy system for teaching computer programming. TI-Basic is similar to other flavors of BASIC, but you must select the programming words and commands from the onboard menus, as you will soon see.
The TI-84 Plus CE graphing calculator is recommended for an optimal experience.
Requirements
Junior Coding for Good, Badge 1 requirements:
1. Create algorithms for a computer that follow a sequence.
2. Use loops to improve your algorithm.
3. Keep your code interesting with conditionals.
4. Create your own set of commands that use conditionals.
5. Learn about women in computer science.
Be sure to review the “Junior Coding for Good” guide for the badge requirements and badge steps provided by the Girl Scouts and your leader. It also includes relevant vocabulary and interesting background information to spark your interest in coding. This lesson will allow you to earn Badge 1: Coding Basics using your TI-84 Plus family graphing calculator.
Step 1
For an introduction to programming on a TI-84 Plus family graphing calculator, see the TI Codes lessons. Units 1 through 4 should be enough to get started, including coverage of algorithms and conditionals as the Badge requirements state. After completing those lessons, you will then have a basic understanding and can return to this lesson for the Junior Coding, Badge 1 project. Note: You will follow the step-by-step instructions given on the webpages, but will actually do the coding on your calculator.
How to navigate: You will navigate through each Skill Builder by clicking on the “Step 1” in the right bottom corner. After you complete all the steps in Skill Builder 1, you will then move to Skill Builder 2, and so on until you complete all of Unit 1. You will then move on to Unit 2, 3, 4 ... and do the same thing.
Step 2
After you have completed the TI Codes Units 1–4, you know about:
- The programming process (planning, coding, testing and debugging)
- Using the TI-84 Program Editor and its menus
- Running a program
- Some important pieces of TI-Basic code: Input, Disp, variables and assignment statements, If…Then…Else structures and loops, like For and While (some of these statements are shown to the right)
Step 3
Your Badge 1 project will be a Number Guessing Game. The calculator will select a random number between one and 100, and the player must guess the number:
- The game continues until the player guesses the number
- If the guess is wrong the computer will tell you whether to guess HIGHER or LOWER to get closer to the number
- After the player guesses the number, the computer will report the number of guesses that the player took
A sample run of the program is shown to the right. The player entered the numbers 45, 34 and 12. The program responded with HIGHER and LOWER. Think about the plan. You will begin writing the program next.
Step 4
Our plan is:
- Create some variables
- Use a While loop to keep guessing as long as we have not guessed the number
- In the loop:
- Count the guesses
- Input a guess
- Check to see whether the guess is too high or too low
- After the loop:
- Display a congratulations message
- Display the number of guesses
Step 5
Start a new program:
Press [prgm], and select the NEW menu at the top of the screen. Name the program HILOW and press [enter]. You are now using the Program Editor. As you learned in the TI Codes lessons, this Editor changes many of the keys on the keypad.
Step 6
Start by making a random number from one to 100 using randint() found on [math] >Prob. You will see a dialog like the one on the right. Enter 1 for lower:, 100 for upper: and leave n: blank. Highlight Paste and press [enter].
Step 7
The other two variables, G for Guess and C for Count, are given the value 0, as shown. Remember to use the sto key and then the correct letters. Your screen should match the one here.
Step 8
Now make a While…End loop to continue to enter guesses until the guess equals the computer’s number (as long as G does not equal N).
Press [prgm] Ctl to find the While statement, type the condition, G ≠ N, then press [enter] a few times and add the End statement from the same menu.
The does not equal symbol (≠) is on the [test] menu: press [2nd] [math] to see the test menu.
Step 9
Inside the While loop:
- Add 1 to the guess-counter variable C
- Add an Input statement to accept the player’s guess (G) by getting the word Input from the [prgm] I/O menu and add the variable G
- If guess G is less than (<) the number (N) — display “HIGHER”
- If guess G is greater than (>) the number (N) — display “LOWER”
Note: Be sure to write two If… statements even though only one is shown here.
Step 10
After the End of the While loop:
- Display “YOU GOT IT.”
Display the number of guesses (C) that the player took to guess the number
Step 11
Now test your program, and make changes as needed.
To run the program:
Press [quit] ([2nd] [MODE]) to return to the HOME screen.
- Press [PRGM].
- Under the EXEC (‘execute’) menu, select your program.
- Press [ENTER] to paste the program name on the HOME screen.
- Press [ENTER] again to begin the run.
Step 12
For the final part of the badge requirement, remember to research “women in computer science,” such as Margaret Hamilton, who helped humans land on the moon. Use the internet for your searching.
Step 13
Congratulations!
You have completed the requirements for earning your Junior Coding for Good, Badge 1: Coding Basics. Now that you have completed this requirement, you are challenged to give service by sharing what you have learned about coding with others. Refer to the “Coding for Good” Girl Scout guide for suggestions on how to do so.
Step 14
What’s next? (Optional extensions)
Ready to try some additional practices with your new skills?
- Try these to edit your game from above:
- Before the game begins, let the player enter the upper number (100 in the lessons) to play with. Input T and use randInt(1,T) instead of randInt(1,100).
- “Trickster”: Want to play a trick on the player? After each guess, have the program pick a new random number. Do you think the player will ever get the number?
- “Warm or Cold”: Guess the number from one to 100 again, but this time, the computer responds with “Freezing-Cold-Warm-Hot-Boiling” depending on how close the guess is to the answer. You can decide just what each of those words means in your code, but do not tell the player.
Step 15
Optional extensions (continued):
-
Whitney Wolfe Herd is an American entrepreneur. She is founder and CEO of Bumble, a popular social and dating app. Bumble launched in 2014 and now the company is now valued at more than 1 billion dollars.
How much is 1 billion (1,000,000,000)? How long is 1 billion seconds in days and years? Use the calculator. How long will it take to spend 1 billion dollars? Write a program to let the user enter the amount she spends in one day and display 1) how many days and 2) how many years it will take to spend 1 billion dollars.
-
Did you know you can create other “graphical” games on your calculator? Take a peek at the projects “SNAKE” or the “MAZE” in the Beyond Basics projects to try your hand at a few simple games.
Warning: These projects are more complex and made up of mini-projects, but would be an excellent challenge!!
Cadette: Coding for Good, Badge 1 >>
Introduction
The programming language BASIC (stands for Beginner’s All-purpose Symbolic Instruction Code) was developed in the 1960s as an easy system for teaching computer programming. TI-Basic is similar to other flavors of BASIC, but you must select the programming words and commands from the onboard menus, as you will soon see.
The TI-84 Plus CE graphing calculator is recommended for an optimal experience.
Requirements
Cadette Coding for Good, Badge 1:
meme, functions, pseudocode, shareable
1. Learn about functions and arguments.
2. Explore how memes are created.
3. Write pseudocode for a meme.
4. Write shareable code.
5. Share your meme.
Be sure to review the “Cadette Coding for Good” guide for the badge requirements and badge steps provided by your leader and the Girl Scouts. It also includes relevant vocabulary and interesting background information to spark your interest in coding. This lesson will allow you to earn the Badge 1: Coding Basics using your TI-84 Plus family graphing calculator.
Step 1
For an introduction to programming on a TI-84 Plus family graphing calculator, see the TI Codes lessons. Units 1 through 5 should be enough to get started, including coverage of algorithms and conditionals as the Badge requirements state. After completing those lessons, you will then have a basic understanding and can return to this lesson for the Cadette Coding, Badge 1 project. Note: You will follow the step-by-step instructions given on the webpages, but will actually do the coding on your calculator.
How to navigate: You will navigate through each Skill Builder by clicking on the “Step 1” in the right bottom corner. After you complete all the steps in Skill Builder 1, you will then move to Skill Builder 2, and so on until you complete all of Unit 1. You will then move on to Unit 2, 3, 4 ... and do the same thing.
Step 2
After you have completed the TI Codes Units 1–5, you know about:
- The programming process (planning, coding, testing and debugging)
- Using the TI-84 Program Editor and its menus
- Running a program
- Some important pieces of TI-Basic code: Input, Disp, variables and assignment statements, If…Then…Else structures and loops, like For and While (some of these statements are shown to the right)
- Using Graphics Commands
Step 3
Your Badge 1 project will be to create a “meme.” Before pressing the buttons, think about the idea of a meme and how the TI-84 Plus family graphing calculator can produce graphics and text to convey a relevant message.
There are several functions on the [draw] ([2nd] [prgm]) menu that let you design interesting graphics and text. These functions produce points, lines, circles, text and more. Unit 5 of the TI-84 Codes lessons dealt with Graphics commands on the TI-84 and TI-84 Plus CE graphing calculators.
This lesson will review some basic graphics functions. Get creative!
Step 4
When designing a screen for graphics display, use some setup commands that are found on [draw], [format], [statplot] and [zoom] keys. Note that ALL calculator commands can be found on the [catalog] key ([2nd] [0]). Once in the catalog, press the first letter of the command you want, scroll down until you find it and press [enter] to add it to your program.
For the TI-84 Plus CE: In the example to the right, the keyword RED is a special color variable that must be selected from [vars] > COLOR.
Step 5
To draw some text (words) on the graphics screen use
Text(x, y, ”MESSAGE”)
If you use the command in the image to the right you will see the word
MEME
starting on line 50, column 10 of the graph screen when you run the program.
For the TI-84 Plus CE: Displayed in the current TextColor, perhaps like this:
TextColor GREEN
Note:
- If you are using a TI-84 Plus, your graph screen is 96x64 pixels
- If you are using a TI-84 Plus CE, your graph screen is 264x164 pixels
Step 6
Besides Text, you can use other DRAW commands found on the [draw] menu ([2nd] [prgm]):
- Line(A,B,C,D) draws a segment between the points (A,B) and C,D)
- Circle(A,B,R) draws a circle with center at (A,B) and a radius R
Both of these commands depend on the current window setting for the coordinates.
Step 7
Points can be plotted using the commands on the [draw] POINTS menu:
- Pt-On(A,B) plots a point at (A,B) depending on the current window
- Pxl-On(R,C) plots a point at row R, column C of the screen (ignoring the window setting)
Step 8
Pic (picture) files: If you have a good screen drawing, you can store it in one of the 10 Pic variables.
On the graph screen or home screen, press [draw] STO.
StorePic 1 stores the current graphic screen in the variable Pic1.
RecallPic 1 will paste the pixels in Pic1 onto the screen.
You can include these statements in your program to build a graphic screen piece by piece.
Step 9
Background images:
If you are using a TI-84 Plus CE, you have special storage space for 10 Background images. These can be loaded from a computer to your calculator using the free TI Connect™ CE software application.
From the HOME screen (not in the Program Editor) press [format] and use the Background: item to see the background images that are stored in your calculator. The preloaded Image4 is shown to the right.
Step 10
For the TI-84 Plus CE Users:
In your program, use the [draw] BACKGROUND command
BackgroundOn 1
to load background Image1 onto the screen.
Using multiple images, you can even create an animated “movie:”
:For K,0,9
:BackgroundOn K
:End
Step 11
Sharing your project:
You can take a picture of your calculator screen to share with the world!
Share it on Instagram, or other social media, and be sure to tag it @TICalculators
Step 12
Here is a sample TI-84 Plus CE program and its result:
(You must select RED and GREEN from the [vars] COLOR menu)
(On the TI-84 Plus omit the TextColor and BackgroundOn statements and the variavble GREEN in the Circle statement.)
The Background image 1 was loaded (as a .jpg) onto the calculator using TI Connect™ CE software.
Step 13
Congratulations!
You have completed the requirements for earning your Cadette Coding for Good, Badge 1: Coding Basics. Now that you have completed this requirement, you are challenged to give service by sharing what you have learned about coding with others. Refer to the “Coding for Good” Girl Scout guide for some specific suggestions on how to do so.
Step 14
What’s next? (Optional extensions)
Ready to try some additional practices with your new skills?
Unit 5 of the TI Codes lessons shows you how to design lots of unique images, create animations and develop challenging games. In the TI Codes Unit 5 Application, you made a ball “bounce” around on the screen. Now add a “paddle” that you can move left or right across the bottom edge of the screen using the arrow keys. Modify the program so that only if the ball hits the paddle it bounces up, otherwise you lose the game. For scoring, count the number of times that the ball hits the paddle. Report the score at the end of the game.
Step 15
Optional extensions (continued)
See the Basketball Game in the Beyond Basics section of TI Codes.
After completing a series of 8 mini-projects, you will have a basketball game similar to the one on the right. ** TI-84 Plus CE calculator is required for this project.
Step 16
Optional extensions (continued)
Write a program to draw the “smiley face,” the original emoji.
The TI-84 Plus does not have a fill command for filling in a circle but you can make a filled circle using a For loop to start with a very small circle and then increase the radius to the desired size.
(or an emoji of your own design)
Be sure to share your work on social media, and don’t forget to tag us @TICalculators!
Senior: Coding for Good, Badge 1 >>
Introduction
The programming language BASIC (stands for Beginner’s All-purpose Symbolic Instruction Code) was developed in the 1960s as an easy system for teaching computer programming. TI-Basic is similar to other flavors of BASIC, but you must select the programming words and commands from the onboard menus, as you will soon see.
The Senior Level, Badge 1: Coding Basics
consists of two separate programming projects:
- A graphics program to produce a self-portrait, and
- A quiz program to help someone learn or review facts or a skill
The TI-84 Plus CE graphing calculator is recommended for an optimal experience.
Requirements
Senior Coding for Good, Badge 1 requirements:
Self-portrait
1. Use functions to create a self-portrait.
2. Write code to create a portrait.
Quiz
1. Learn about computer logic.
2. Explore “If” statements.
3. Use computer logic to create a quiz show.
Be sure to review the “Senior Coding for Good” guide for the badge requirements and badge steps provided by your leader and the Girl Scouts. It also includes relevant vocabulary and interesting background information to spark your interest in coding. This lesson will allow you to earn Badge 1: Coding Basics, using your TI-84 Plus family graphing calculator
Step 1
For an introduction to programming on a TI-84 Plus family graphing calculator, see the TI Codes lessons. Units 1 through 5 should be enough to get started, including coverage of algorithms and conditionals as the Badge requirements state. After completing those lessons, you will then have a basic understanding and can return to this lesson for the Senior Coding, Badge 1 project. Note: You will follow the step-by-step instructions given on the webpages, but will actually do the coding on your calculator.
How to navigate: You will navigate through each Skill Builder by clicking on the “Step 1” in the right bottom corner. After you complete all the steps in Skill Builder 1, you will then move to Skill Builder 2, and so on until you complete all of Unit 1. You will then move on to Unit 2, 3, 4 ... and do the same thing.
Step 2
After you have completed the TI Codes units 1-5, you know about:
- The programming process (planning, coding, testing and debugging)
- Using the TI-84 Basic Program Editor and its menus
- Running a program
- Some important pieces of TI-Basic code, including: Input, Disp, variables and assignment statements, If…Then…Else structures and loops, like For and While (some of these statements are shown to the right)
- Using Graphics Commands
Step 3
Part 1: Self-portrait. Plan your project on paper first!
There are several functions on the [draw] menu shown to the right that let you design interesting graphics. These are covered in Unit 5: Graphics of the TI Codes lessons you completed. These functions produce points, lines, circles, text and more.
Tip for the TI-84 Plus CE: The BACKGROUND menu lets you add a background image to the graph screen. Background images (.jpegs) can be loaded onto your calculator using the free TI Connect™ CE software application for your computer.
Step 4
Start a new program (press [prgm] > NEW), and name it SELFPORT.
When designing a screen for graphics display, we will use some setup commands that are found on several menus: [draw], [format], [statplot], [vars] and [zoom].
The commands shown are to ensure that the program begins with a blank graph screen: no axes, no functions being graphed, no stat plots showing, and a friendly window where circles appear round.
Remember that these, and all, calculator commands can be found on the [catalog] key ([2nd] [0]). Once in the catalog, press the first letter of the command you want, scroll down until you find the command you want, and press [enter] to add it to your program.
Step 5
Also, while pointing to a command on a menu, pressing the [+] key will show the CATALOG HELP screen. Help for the Line( statement is shown here. When you select a function, you will get an informational screen. You can complete the command at the top of the screen and then press [PASTE] (use the [zoom] key) to paste the entire completed statement into your program.
To draw a line segment, use the Line( ) function from the [draw] menu which requires four (or more) arguments.
Line(0, 0, 4, 5)
draws a line segment between the points (0,0) and 4,5) using the current window setting.
For the TI-84 Plus CE: Line(0,0,4,5, RED) makes a red line.
Get the variable RED from [vars] COLOR. You cannot simply type the letters R-E-D. Reminder: [2nd] [PRGM] accesses the DRAW menu. Tip 1: Remember to always close the parenthesis! It’s a good habit.
Step 6
To draw a circle:
Circle(-2, 1, 5)draws a circle with center at (-2,1) and radius 5 using the current window setting.
To draw text on the screen:
Text(30,50,”HELLO”)
Draws the word HELLO at the pixel on row 30, column 50 of the screen regardless of the window setting!
Reminder: “ is on the [alpha] [+].
Note: The TI-84 Plus graph screen is 64 rows by 96 columns. The
TI-84 Plus CE graph screen is 164 rows by 264 columns.
Run your program. Press ([2nd] [MODE]) to Quit and return to the HOME screen. Then [prgm] and under the EXEC menu, select your program.
Step 7
The Line, Circl, and Text commands should produce the screen shown to the right.
Circle(-2, 1, 5, BLUE)
Line(0, 0, 4, 5, RED)
Text(30,50,”HELLO”)
On a TI-84 Plus, the image is black and white.
Tip for the TI-84 Plus CE: Use the separate TextColor( ) function on the [draw] menu to set the text color before drawing text. If you don’t see the RED, you probably typed in the word, instead of using the menu choice. You cannot just type the color in, you must use the menu.
As a reminder, to get back to your program code to edit further:
- Press [PRGM]
- Choose the EDIT menu using the arrow keys
- Select your program and press [ENTER]
Step 8
Freehand drawing and coding.
From the Home screen or Graph screen, select [draw] Pen, a freehand drawing tool. Move the cursor around on the graph screen, press [enter] to put the pen down (or up) and make a sketch. The screen to the right shows the pen drawing in progress.
Tip for the TI-84 Plus CE: The STYLE menu ([graph]) lets you change the pen color.
Hold on … since pen drawing is not “programming,” you must now save your drawing in a Pic file that can be incorporated into your code. If you modify the graph screen before saving, your drawing will be lost. See the next step on how to save the drawing
Step 9
StorePic 1 or StorePic Pic1
It will have the same result.
After saving you will return to the drawing screen. You can press [quit] now to go to the home screen
Step 10
Now we need to add code to your program to include that drawing (Pic file). Use [draw] STO RecallPic # to add the stored pixels to your project. Any previous drawing effects remain on the screen.
To insert blank lines in your program:
- Place the cursor at the insertion point (the beginning of a line)
- Press [2nd] [del] for [insert]
- Press [enter]
- Press [uparrow] to place the cursor on the new blank line
Step 11
Step 12
(TI-84 Plus CE only) To use a background image in your program, in addition to Pic files, the TI-84 Plus CE can store Image files for use as a background image on the Graph screen. It comes with some preloaded image frills from the factory. Press [vars] > Pictures and Background > Background and look through the images.
Step 13
(TI-84 Plus CE only) The statement BackgroundOn 1 places image #1 in the background of your graph screen without disturbing any of your current drawing.
To use your own image file, use the free TI Connect™ CE software to transfer a picture from your computer to your calculator using a USB cable.
This is an example of a background image. This scout image is located in the download folder if you want to try and put it on your calculator.
Step 14
Now it’s your turn! Try and use a combination of these graphics tools to make your own creative self-portrait program.
To share your project, you can take a picture of the screen for sharing with friends and family, or you can use TI-Connect™ CE software to capture a screenshot for sharing. If you share on social media, don’t forget to tag it @TICalculators!
Step 15
Part 2: Quiz
Calculator programming is a good way to develop a program that can allow a child to practice their arithmetic skills! You can easily expand on this demonstration program in several ways.
Step 16
The plan
The program will ask 10 addition questions. The two numbers, called addends, are generated using randInt( ). The program keeps track of the number right and the number wrong and displays those results at the end. The screen is organized using Output() statements.
Begin a new program (press [prgm] NEW [enter]) and name it ADD and press [enter] again.Step 17
- Add a For loop to control the number of problems (we are going to display 10 problems). Press [prgm] and locate the For( statement on the CTL menu, then type the rest of the statement.
- Use two randInt() functions to pick two random number to add together (we’re using random numbers from 1 to 10). randInt( is on the [math] PROB menu. Store (→) the randInts in two variables, A and B.
Step 18
Display the problem using Output( ) statements to position each part of the expression on the screen in the proper location. Use ClrHome (on [prgm] I/O) to clear the screen and find Output( on [prgm] I/O as well.
Output( uses the structure Output(line#, column#, item). Item can be a variable or “literal string” (something in quotes). In the example screen, all output appears on line five of the display.
Use an Input statement to get the answer from the user. Since the Output statement does not affect the cursor position, use some Disp statements to move the cursor lower on the screen.
Step 19
Use an If and an Else statement to determine if the users answer is right and update one of the two counters accordingly.
Remember that If, Then, Else and End are four separate commands, all on the [prgm] CTL menu, and that each belongs on a line of its own (with a condition after If).
Step 20
After the End of the For loop, report the results.
Remember that there will be two End statements in your program, one for the If structure and one for the For structure.
Using this program as a start, you can improve the program in many ways. Get creative! Some suggestions to try are listed in the Extensions (optional).
Be sure to share your work on social media, and don’t forget to tag it @TICalculators!
Step 21
Congratulations!
You have completed the requirements for earning your Senior Coding for Good, Badge 1: Coding Basics. Now that you have completed this requirement, you are challenged to give service by sharing what you have learned about coding with others. Refer to the “Coding for Good” Girl Scout guide for suggestions on how to do so.
Step 22
What’s next? (Optional extensions)
Ready to try some additional practices with your new skills?
- In the self-portrait graphics project, once your final image is complete, you can store the image in any one of the PICTURE variables (see [vars] PICTURE and [draw] STO menus). You can then have several picture variables stored with slightly different images, and then write a program that displays the images one at a time to create an animation:
:For K,1,5
:ClrDraw
:RecallPic K
:Wait .1
:End
- In the ADD project:
- Let the user enter the number of problems
- Display (Output) the problem number at the top of the screen
- Choose the operation (addition, subtraction, multiplication, division)*
- Offer multiple tries (“Wrong, try again.”); add points for getting it right on 1st try, 2nd try, etc.
- Improve the results screen shown using Output statements
- Display a percent score at the end
For division, to ensure integer answers, choose two random numbers, determining their product. Display the product and one of the divisors. The user then determines the other divisor.
Step 23
Optional extensions (continued)
3. See the activity “Back in Time?” found at Back In Time? Algebra I. Use the program MACHINE provided to develop a function guessing game of your own. You may need to do some research on the use of the Menu( ) feature of TI-Basic. As an extension to MACHINE, offer another multiple-choice question at the end of each function that shows three or four different function expressions and the student has to pick the correct one.
Ambassador: Coding for Good, Badge 1 >>
Introduction
The programming language BASIC (stands for Beginner’s All-purpose Symbolic Instruction Code) was developed in the 1960s as an easy system for teaching computer programming. TI-Basic is similar to other flavors of BASIC, but you must select the programming words and commands from the onboard menus, as you will soon see.
The TI-84 Plus CE graphing calculator is recommended for an optimal experience.
Requirements
Song lyrics; sound using the TI-Innovator™ Hub
1. Learn about functions through song lyrics.
2. Learn about loops through song patterns..
3. Write an algorithm duet.
4. Code a performance routine.
5. Share your coded routine with others.
Be sure to review the “Ambassador Coding for Good” guide for the badge requirements and badge steps provided by your leader and the Girl Scouts. It also includes relevant vocabulary and interesting background information to spark your interest in coding. This lesson will allow you to earn Badge 1: Coding Basics using your TI-84 Plus family graphing calculator.
Step 1
For an introduction to programming on a TI-84 Plus family graphing calculator, see the TI Codes lessons. Units 1 through 4 should be enough to get started, including coverage of algorithms and conditionals as the Badge requirements state. After completing those lessons, you will then have a basic understanding and can return to this lesson for the Ambassador Coding, Badge 1 project. Note: You will follow the step-by-step instructions given on the webpages, but will actually do the coding on your calculator.
How to navigate: You will navigate through each Skill Builder by clicking on the “Step 1” in the right bottom corner. After you complete all the steps in Skill Builder 1, you will then move to Skill Builder 2, and so on until you complete all of Unit 1. You will then move on to Unit 2, 3, 4 ... and do the same thing.
Step 2
If you are using a TI-84 Plus CE graphing calculator and plan to use a TI-Innovator™ Hub for sound (optional), then also check out the TI-Innovator™ lessons at 10 Minutes of Code (for TI-84 Plus and TI-Innovator™ technology).
Step 3
After you have completed the TI Codes units, you know about:
- The programming process (planning, coding, testing and debugging)
- Using the TI-84 Plus Program Editor and its menus
- Running a program
- Using the TI-Innovator™ Hub (optional)
- Some important pieces of TI-Basic code: Input, Disp, variables and assignment statements, If…Then…Else structures and loops, like For and While (some of these statements are shown to the right)
Step 4
The basic structure of songs is the verse, chorus and refrain structure. When a portion of a song is repeated (like the chorus or refrain), then it is a perfect opportunity to incorporate a subroutine in computer programming. Your main program (PERFORM1 in the image to the right) can “call” another program (prgmPREFRAIN or prgmPCHORUS) to display the refrain or chorus at the proper times.
This sample program uses the lyrics from the Beatles song “She Loves You.”*
Step 5
To start a program, press [prgm], arrow right to NEW, press [enter], type the name of the program (we use PERFORM1), and press [enter] again.
This example uses three separate programs.
Step 6
The main program PERFORM1, and the two subroutines PREFRAIN and PCHORUS, are listed as three separate programs on the [prgm] menu to the right (along with other, unrelated programs).
You must write separate programs. We are using PERFORM1, PCHORUS and PREFRAIN. They all start with the letter P so that they appear in the same area on the alphabetical list of programs shown to the right.
Step 7
In your programs, use Disp statements (found on [prgm] I/O) to display each line of the song, one at a time. Be sure to put the line in quotes.
To type a long string of characters you can turn on alpha-lock (2nd [alpha]). Be sure to turn it off later by pressing [alpha] before pressing other keys like the up/down arrow keys because alpha-up and alpha-down are PgUp and PgDn keys. Pay attention to the cursor.
Step 8
In your main program, you can “call” or use the subroutine by entering its name on a line of its own. Note the statement containing prgmPREFRAIN in the image to the right. When the processor encounters this statement, it will run the code in that program (and bookmark the location in this program where it left off).
The statement :“[Verse 2] is a comment and is not displayed when the program runs. This is a good way to add personal notes to your programs.
EDITING TIPS
To insert lines in your code:
- Place the cursor at the insertion point (the beginning of a line)
- Press [2nd] [del] for the [insert] mode
- Press [enter]
- Press [uparrow] to place the cursor on the new blank line
If you accidentally press the [clear] key (which erases the entire line of code!) you can restore the lost line by pressing [alpha][graph] (the F5 key) and choose “Undo clear” from the menu. There are other useful tools on that menu as well.
Step 9
To add the subroutine program name into your main program (to “call” the subroutine) on a blank line in the main program, press [prgm], arrow to the EXEC list, and locate the name of your subroutine in the list of all your programs. The subroutine must be created before it can be found on this list. It does not have to be complete or even correct, but the program name must exist.
Note that the screen to the right is showing the EXEC menu.
Step 10
Your subroutine displays the refrain or chorus (shown) and then the returns control to the bookmarked spot in your main program to continue the rest of the song.
Note the use of the Wait statement to control the display of the lyrics. Wait is found on [prgm] CTL. Wait is followed by the number of seconds to wait. Wait 1 means “wait one second.”
EDITING TIP
Use the [F5] key ([alpha][graph]) to copy and paste a line of code.
Step 11
Step 12
For an audio challenge using a TI-84 Plus CE and TI-Innovator™ Hub, write a song and include the SOUND commands with the proper notes (or frequencies) and timings (Wait). Perhaps you can even sync the sounds with the lyrics to make a karaoke machine!
The Send and Wait statements in this screen are incomplete, and the actual code is more involved. For more information, see the
TI-Innovator™ lessons at 10 Minutes of Code .
If you are sharing on social media, remember to tag it @TICalculators
Step 13
Congratulations!
You have completed the requirements for earning your Ambassador Coding for Good, Badge 1: Coding Basics. Now that you have completed this requirement, you are challenged to give service by sharing what you have learned about coding with others. Refer to the “Coding for Good” Girl Scout guide for other suggestions on how to do so.
Step 14
What’s next? (Optional extensions)
Ready to try some additional challenges with your new skills?
- The Beyond Basics section of TI Codes provides several interesting programming projects. In keeping with the theme of this badge, try the Piano project or the Musical Scale project. Both make use of the TI-Innovator™ Hub for making sounds.
- Make your programs more efficient using subroutines/subprograms as described in this lesson to play the different sections of the songs
The TI expert in your area is available to make sure Girl Scouts have everything they need to earn their first Coding for Good badge.
If you have questions about getting started, the Girl Scouts Volunteer Guide helps explain what you can do to get your Girl Scouts coding.
Learn even more about how an TI expert can help Girl Scouts create content-rich, valuable learning experiences with coding and STEM activities.