Corning Community College ENGR1050 C for Engineers Assignments, Documents, Information, and Projects ======Projects====== | [[/haas/fall2019/c4eng/projects/pct0|pct0]] (bonus; due 20190821) | | [[/haas/fall2019/c4eng/projects/cci0|cci0]] (due 20190821) | | [[/haas/fall2019/common/projects/wcp|wcp1]] (due 20190821) | | [[/haas/fall2019/c4eng/projects/dtr0|dtr0]] (bonus; due 20190828) | | [[/haas/fall2019/c4eng/projects/pctX|pct1]] (due 20190828) | | [[/haas/fall2019/common/projects/wcp|wcp2]] (due 20190828) | | [[/haas/fall2019/c4eng/projects/pctX|pct2]] (due 20190904) | | [[/haas/fall2019/common/projects/wcp|wcp3]] (due 20190904) | | [[/haas/fall2019/c4eng/projects/sof0|sof0]] (due 20190911) | | [[/haas/fall2019/c4eng/projects/pctX|pct3]] (due 20190911) | | [[/haas/fall2019/common/projects/wcp|wcp4]] (due 20190911) | | [[/haas/fall2019/c4eng/projects/dow0|dow0]] (due 20190918) | | [[/haas/fall2019/c4eng/projects/pctX|pct4]] (due 20190918) | | [[/haas/fall2019/common/projects/wcp|wcp5]] (due 20190918) | | [[/haas/fall2019/c4eng/projects/mtf0|mtf0]] (due 20190925) | | [[/haas/fall2019/c4eng/projects/pctX|pct5]] (due 20190925) | | [[/haas/fall2019/common/projects/wcp|wcp6]] (due 20190925) | | [[/haas/fall2019/c4eng/projects/mtf1|mtf1]] (due 20191002) | | [[/haas/fall2019/c4eng/projects/pctX|pct6]] (due 20191002) | | [[/haas/fall2019/common/projects/wcp|wcp7]] (due 20191002) | | [[/haas/fall2019/c4eng/projects/bcf0|bcf0]] (due 20191010) | | [[/haas/fall2019/c4eng/projects/epf1|epf1]] (due 20191010) | | [[/haas/fall2019/c4eng/projects/pctX|pct7]] (due 20191009) | | [[/haas/fall2019/common/projects/wcp|wcp8]] (due 20191009) | | [[/haas/fall2019/c4eng/projects/cnv0|cnv0]] (due 20191023) | | [[/haas/fall2019/c4eng/projects/pctX|pct8]] (bonus; due 20191023) | | [[/haas/fall2019/c4eng/projects/pctX|pct9]] (due 20191023) | | [[/haas/fall2019/common/projects/wcp|wcp9]] (due 20191023) | | [[/haas/fall2019/c4eng/projects/cnv1|cnv1]] (due 20191030) | | [[/haas/fall2019/c4eng/projects/pctX|pctA]] (due 20191030) | | [[/haas/fall2019/common/projects/wcp|wcpA]] (due 20191030) | | [[/haas/fall2019/c4eng/projects/fwf0|fwf0]] (due 20191106) | | [[/haas/fall2019/c4eng/projects/pctX|pctB]] (due 20191106) | | [[/haas/fall2019/common/projects/wcp|wcpB]] (due 20191106) | | [[/haas/fall2019/c4eng/projects/cos0|cos0]] (due 20191113) | | [[/haas/fall2019/c4eng/projects/pctX|pctC]] (due 20191113) | | [[/haas/fall2019/common/projects/wcp|wcpC]] (due 20191113) | | @lightgreen:[[/haas/fall2019/c4eng/projects/eoce|eoce]] (due 20191211 by 172959) | ======Class Stats====== * [[/haas/fall2019/c4eng/projects/status|status]] (coming at some point) ======URLs====== * [[http://publications.gbdirect.co.uk/c_book/|The C Book, online C book]] * [[http://publications.gbdirect.co.uk/c_book/thecbook.pdf|PDF of above]] * [[/_media/haas/printf.pdf|printf PDF]] ======Week 7====== * continued exposure utilizing loops in problem solving * possible integration of arrays to further streamline process * binary counter in incrementing and decrementing fashion ======Week 6====== =====colorled===== * multi-coloured (RGB) LED, using PWM to set different intensities of Red, Green, and Blue (100 different levels of adjustment for each) * In the **examples** subdirectory, there is now a **colorled** entry with a sample program. Here's a diagram of the circuit to assemble: {{:haas:fall2019:c4eng:rgbled.png?400|colorled diagram}} ====Lab Project==== Once you have the circuit wired up and verify operation with the sample program, I'd like you to write a new program that: * starts at "nothing" (no light) * going from nothing and gradually (10 steps) to full intensity: * nothing to red, then reset, and go: * nothing to green, then reset, and go: * nothing to blue, then reset, and go: * nothing to purple, then reset, and go: * nothing to red+green, then reset, and go: * nothing to green+blue, then reset, and go: * nothing to white (red+green+blue). ===Hints=== * Figure out how to set the level of ONE color to its maximum value * How would you adjust these across a given range (0-99) * One thing at a time: worry about JUST red first, then JUST green. ===Copying sample file from lab46 to your pi=== lab46:~$ cd /var/public/fall2019/c4eng/examples/colorled lab46:/var/public/fall2019/c4eng/examples/colorled$ ls colorled.c lab46:/var/public/fall2019/c4eng/examples/colorled$ scp colorled.c pi@10.80.2.X: On the scp line, do NOT forget the trailing colon. It is important. ===Copying a file from the pi to lab46=== pi@raspberrypi:~$ ls program.c pi@raspberrypi:~$ scp program.c user@lab46: ===Submit=== When done, submit your source code on lab46 for the project **epf0** ======Week 5====== =====potled===== * potentiometer + LED * potled.c now placed in **examples** subdirectory. It has been enhanced with further comments. * NOTE: In order to run this program, we will need to enable I2C support on the pi (a one-time thing, then we're set). Here's a diagram of the parts needed and circuit to assemble: {{:haas:fall2019:c4eng:potled.png?400|potled diagram}} =====buzzer===== * button + buzzer * buzzer.c now placed in **examples** subdirectory. It has been enhanced with further comments. * NOTE: This program is functionally similar to our buttonled.c program we worked on earlier. Here's a diagram of the parts needed and circuit to assemble: {{:haas:fall2019:c4eng:buzzer.png?400|buzzer diagram}} ======Week 4====== =====buttonled===== * The "buttonled" programs we wrote in class have been added underneath the **examples** subdirectory in the **c4eng public directory**, including additional comments. * buttonled.c - basic program; press button to light up LED * buttonled2.c - LED will appear to "blink" for the duration of the button press * Please make sure you are reading through the chapter on if statements/selection structures/conditional statements. Here's a diagram of the parts needed and circuit to assemble: {{:haas:fall2019:c4eng:buttonled.png?400|buttonled diagram}} ======Week 3====== * I have put together a [[/haas/fall2019/c4eng/projects/sof0info|sof0 hints page]], that may have some useful information you want to check out if you are having trouble getting started. * Please make sure you are reading through the chapter on variables and arithmetic operations. ======Week 2====== * After getting through the typically chaotic first week activities, the dust is starting to settle; questions are being asked, things are being figured out. * We went through the "Hello, World!" C program, and then moved onto the next programming project, **dtr0**. * There are likely some questions on a number of aspects related to **dtr0**. I am endeavouring to put together a [[/haas/fall2019/c4eng/projects/dtr0info|document to provide some additional background information]]. * The **pct1** project is also in progress. For some of the more technical aspects of the project, I have also put together a [[/haas/fall2019/c4eng/projects/pctXinfo|document to provide some additional background information]]. ======Week 1====== * Welcome! I've wrapped some initial activities into the **cci0** and **dtr0** projects, that I'd like you to perform by the given deadlines (by 11:59:59pm / 23:59:59 on posted day). * If you've never used a UNIX system before, I'd recommend reading **{{:haas:ufbm.pdf|UNIX for the Beginning Mage}}**; it is short, and likely one of the best reads you'll ever have. * Get familiar with how to log onto Lab46, and once on: * change to your **src/** subdirectory * create/edit .c files (such as **hello.c**), and learn how to save/exit * compile the C program (.c file(s)) into an executable with **gcc** * execute the compiled C program (the executable) by specifying a path: **./program_name**