An Overview of Module 000: Getting Started
As you begin with imperative problem solving, the C programming language, the eSpeak speech synthesizer, and the MyroC environment for controlling robots, you will need to learn several mechanics and procedures. None of these activities is conceptually difficult, but each may be unfamiliar and seem awkward at first. Working with a programming environment (particularly with C) may be quite different from what you have done with computing previously, and this module provides you with the basic background.
As an analogy, in learning to play a guitar or trumpet or flute or other musical instrument, you first need to learn how to hold it, where to put your hands and fingers, how to create a sound, etc. The mechanics require some practice at first, and playing a note just gets you started in playing an entire song or composing music.
An Outline of Module 000
For writing C programs, the initial mechanics similarly may seem new and different, but before long these details will become second nature, and you can move onto more interesting adventures. Here are some features and highlights as we start.
-
The Terminal Window: If you have used computers in the past, you likely used a mouse to locate something of interest, and you clicked on a button to select an application or option. Sometimes you may have used the mouse to identify a blank text area and you entered information by typing on a keyboard. Although all of this activity can be effective in some contexts, using mouse clicks is limited and does not allow you to utilize the full capabilities of a computer.
For programming effectively in C, you will need to open a terminal window, set up directories to organize your work, create files, issue commands to the computer's operating system, and run various tools. Since your experience using terminal window may be limited, the first lab provides practice with common commands and capabilities available within the Linux or Mac OS X environment.
-
Writing and Running C Programs: When writing algorithms in C, you use a simple text editor (e.g., emacs or textedit) to type instructions following a specific syntax. Instructions in C tend to be somewhat cryptic, but some elements are generally similar to a simplified English or mathematical format.
A C program largely provides a human-readable format for instructions. Once a C program is written, a translator (called a compiler) is needed to translate the program to a machine format that a computer can utilize. Linux and Mac OS X provide appropriate compilers, so the second lab reviews how to create a C program and then compile it — yielding a machine-language version of your instructions. The lab also provides practice with running the program, once it is prepared.
-
eSpeak and MyroC: Once you can write a simple C program, the next steps involve expanding the capabilities to include the use of a speech synthesizer and the control of Scribbler 2 robots. The infrastructure for this course provides libraries (eSpeak and MyroC) for use within C programs. The third and fourth labs explain the needed details.
-
Organizing instructions with functions: Once you know how to get the computer to speak and issue commands to robots, you may observe patterns in what you wish to do. For example, in playing a song, there may be several verses, with a common chorus or refrain after each verse. In robot movement, the robot may follow a sequence of moves, turn right, and repeat the initial sequence. When patterns are present, repeating the same instructions several times can be tedious and error prone. Thus, the next lab introduces the concept of functions to help take advantage of patterns.
-
Project: With several basics identified, a flexible project allows you put the pieces together in creative ways. You can practice the basics while focusing on refining a song or dance of your choosing.
Initial Goal
The goal of Module 000 is to master sufficient mechanics to be able to write a few simple C programs that
- produce some output by printing to the screen
- invoke a speech synthesizer (called eSpeak), so the computer can talk to you
- issue commands to a robot, so it can beep, play songs, and move
- explore some simple ways to organize your work.
created 2 May 2016 by Henry M. Walker revised 5 May 2016 by Henry M. Walker |
![]() ![]() |