|
2 | 2 |
|
3 | 3 | Here are some example programs to demonstrate the Pi's capabilities.
|
4 | 4 |
|
5 |
| -In order to run these programs you need to be at the command line. Your Pi may boot to the command line (requiring you to enter `startx` to get to the Desktop) - if so, go straight ahead. Otherwise, use the start button to logout of the Desktop. |
| 5 | +In order to run these programs you need to be at the command line. Your Pi may boot to the command line (requiring you to enter `startx` to get to the desktop); if so, go straight ahead. Otherwise, use the start button to log out of the desktop. |
6 | 6 |
|
7 | 7 | ```
|
8 | 8 | pi@raspberrypi ~ $
|
9 | 9 | ```
|
10 | 10 |
|
11 |
| -This (above) is the command prompt, try not to be afraid of it. A CLI (command line interface) is actually a very quick and efficient way to use a computer. |
| 11 | +This (above) is the command prompt. It looks difficult to use, but try not to be afraid of it! A CLI or command line interface is actually a very quick and efficient way to use a computer. |
12 | 12 |
|
13 |
| -Firstly navigate to the `hello_pi` folder where all the demos are stored. Enter the command below to do this. |
| 13 | +To start, navigate to the `hello_pi` folder where all the demos are stored. Enter the command below to do this. **TIP**: You can use the `TAB` key for auto-complete as you enter commands. |
14 | 14 |
|
15 |
| -TIP: You can use the TAB key to auto-complete commands to save typing them in full. |
| 15 | +`cd /opt/vc/src/hello_pi` |
16 | 16 |
|
17 |
| -``` |
18 |
| -cd /opt/vc/src/hello_pi |
19 |
| -``` |
| 17 | +The command prompt should now look like the text below. The blue part shows where you are in the file system of the Pi. |
20 | 18 |
|
21 |
| -The command prompt should now look like this, the blue part shows where you are in the file system of the Pi. |
| 19 | +`pi@raspberrypi /opt/vc/src/hello_pi $ _` |
22 | 20 |
|
23 |
| -``` |
24 |
| -pi@raspberrypi /opt/vc/src/hello_pi $ |
25 |
| -``` |
| 21 | +If you enter `ls` and press Enter, you’ll see a list of folders; there is one for each demo. Before you can run them, though, they must be compiled. Don’t worry if you don’t understand what this is or why you need to do it; just follow the instructions for now, and we'll learn more about it later on. |
26 | 22 |
|
27 |
| -If you enter `ls` and press enter you'll see a list of folders. One for each demo. Before you can run them though they must be compiled. Don't worry if you don't understand why you need to do this, just take it on faith for now. |
| 23 | +There is a small shell script supplied in the `hello_pi` folder called rebuild.sh which will do the compiling for you. Enter the following command to run it; ignore the gobbledygook for now! |
28 | 24 |
|
29 |
| -There is a small shell script supplied in the `hello_pi` folder called `rebuild.sh` which will do the compile for you, enter the following command to run it. Ignore the Gobbledygook for now! |
| 25 | +`./rebuild.sh` |
30 | 26 |
|
31 |
| -``` |
32 |
| -./rebuild.sh |
33 |
| -``` |
| 27 | +A lot of text will scroll up the screen now, but for this exercise you can ignore it. It is just the output of the compiler as it works through the demo code. Wait for the command prompt to return before you continue. |
34 | 28 |
|
35 |
| -A lot of text will scroll up the screen now, you can ignore it. It is just the output of the compiler as it works through the demo code. Wait for the command prompt to return before you continue. |
| 29 | +Now we’re finally ready to run some demos! |
36 | 30 |
|
37 | 31 | Demo programs:
|
38 | 32 |
|
|
0 commit comments