Some commands to get you get going on lab02 In the following the "$" at the beginning of the line represents the command line prompt. You do not type it, only the rest of the line followed by 1) ssh in to the Raspberry Pi (e.g., ssh pi@grizzly.eece.maine.edu -p 100XX) or use PuTTY. 2) On login, you will be in your home directory. To confirm you "print working directory" $ pwd and it should return the name of your home directry, "/home/pi", assuming "pi" is your username If you are not in your home directory then $ cd or $ cd ~ will take you there 3) Create a new lab02 directory under your home directory $ mkdir lab02 Then change to this directory $ cd lab02 Now copy the file ex01.c from last week's lab to this folder, changing the name to lab02a.c $ cp ../lab01/ex01.c ./lab02a.c the "dot" in the destination means the current folder 3b) Alternately, if the file ex01.c isn't there or has changed, then copy it again from the web site $ wget http://web.eece.maine.edu/eason/ece177/ex01.c ./ ********************************************************* In general for each week's lab you might use last week's lab directory as a starting point to get you going. That is, copy the previous lab's directory to a new directory and work from there, keeping everything you did on the previous lab in it's own directory. From the parent directory of the old and new directories (probably your home directory) type $ cp -rp lab01 lab02 Note that the -rp in the above command says copy the whole directory "recursively" and also keep the permissions (file creation dates). If you copy the previous lab directory, then "cd" to the new directory and remove any files that are not needed for this week (e.g. executables) and also rename last week's files to something appropriate for this week's lab. E.g., Rename ex01.c to (for example) lab02a.c and start editing it. $ mv ex01.c lab02a.c ********************************************************* 4) Modify lab02a.c as needed to complete the first exercise and then compile using $ gcc lab02a.c -o lab02 and run $ ./lab02 5) For the other exercises, copy this source file to the others using, for example $ cp lab02a.c lab02b.c 6) Note that for programs that use "math" functions (e.g., sqrt()), you must include the math library In your source file and add an additional "#include" at the top. #include Then when you compile the source add "-lm" to the "gcc" command: $ gcc -lm lab02c.c -o lab02c