Corning Community College
ENGR1050 C for Engineers
To continue our exploration of interfacing electronics with our pi's, and writing a program that controls it, and collaboratively authoring and documenting the project and its specifications.
To assist with consistency across all implementations, data files for use with this project are available on lab46 via the grabit tool. Be sure to obtain it and ensure your implementation properly works with the provided data.
lab46:~/src/SEMESTER/DESIG$ grabit DESIG PROJECT
Your task is write a program that:
Contributing to project documentation is also a core part of this project. If from reading the existing documentation or through your own exploring, you find something lacking, unclear, or outright missing, that is an opportunity to potentially contribute content.
You want the project documentation to provide you (as if coming in with no awareness of the project) with sufficient information so as to allow you to proceed. Asking questions on the discord is a great way of getting more information that you can use to add content.
You will want to go here to edit and fill in the various sections of the document:
In vcc2 we will continue to build onto that baseline of knowledge that we have established from previous projects such as vcc0 and vcc1, to build an even more complex circuit. In this project we will combine different types of LEDs, buttons and switches to create multiple functions within a circuit. Circuit control, in its simplest form, is the application and removal of power. This can also be expressed as turning a circuit on and off or opening and closing a circuit.
You will use digital pin modes when dealing with signals that are either “on” or “off”, such as an LED, a switch, or another digital IC. Analog and digital signals are used to transmit information, usually through electric signals. In both these technologies, the information, such as any audio or video, is transformed into electric signals. The difference between analog and digital technologies is that in analog technology, information is translated into electric pulses of varying amplitude. In digital technology, translation of information is into binary format (zero or one) where each bit is representative of two distinct amplitudes.
This is a method of reducing the average power produced by an electrical signal by effectively chopping it up into discrete parts. The average value of voltage fed to the load is controlled by turning the switch between supply and load on and off at a fast rate.
The longer the switch is on, the higher the total power is to the supplied to the object. PWMs are particularly suited for running inertial loads such as, which is not as easily affected by this discrete switching because their inertia causes them to react slowly.
This means that the switching frequency must be high enough to not affect the load, which means that the resultant wave must be perceived as smooth by the load.
7 10k ohm resistors 3 buttons 1 switch 2 leds 1 rgb LED 1 220 ohm resistor to each LED including rgb LED (3 for rgb LED) 1k ohm to switch
This LED is basically THREE LEDs packaged together, all sharing a ground. The Red-Green-Blue (RGB) is three LEDs in one. By controlling the intensities of each of the three component colors individually, you can create all of the colors of the rainbow. The RGB LED in your kit is a common-cathode RGB LED. Each of the three shorter legs controls an individual color (red, green or blue). The fourth, longer leg is a shared ground—-the common cathode. In contrast to standard individual LEDs, the cathode leg on a common-cathode RGB LED is longer than the other legs. (https://learn.sparkfun.com/tutorials/experiment-guide-for-the-johnny-five-inventors-kit/experiment-8-driving-an-rgb-led)
You will also want to utilize a switch, which looks like this:
Your kit should have come with a couple of them, you will need ONE. A switch is a component which controls the open-ness or closed-ness of an electric circuit. They allow control over current flow in a circuit (without having to actually get in there and manually cut or splice the wires). Switches are critical components in any circuit which requires user interaction or control.A switch can only exist in one of two states: open or closed.
The switch circuit will involve hooking up 3.3v to the center pin, putting a 1k resistor between the pin of the switch and the 3.3v source coming from the pi. And ONE of the other pins should then go through a 10k resistor into a GPIO pin on the pi (set to INPUT mode, just like the buttons).
This switch is going to control the DIRECTION of change- one way, it will be INCREASING in value. The other, it will be DECREASING.
AS LONG AS PROGRAM CONTINUES TO RUN: SHOULD THE DIRECTIONAL INDICATOR BE UP: LIGHT UP THE UP INDICATOR LIGHT TURN OFF THE DOWN INDICATOR LIGHT SET DIRECTION TO POSITIVE FIVE OTHERWISE: LIGHT UP THE DOWN INDICATOR LIGHT TURN OFF THE UP INDICATOR LIGHT SET DIRECTION TO NEGATIVE FIVE SHOULD THE RED BUTTON BE PRESSED: SET REDLEVEL TO REDLEVEL PLUS DIRECTION SHOULD REDLEVEL EXCEED ONE HUNDRED: RESET REDLEVEL TO ZERO SHOULD REDLEVEL FALL BELOW ZERO: RESET REDLEVEL TO ONE HUNDRED SHOULD THE GREEN BUTTON BE PRESSED: SET GREENLEVEL TO GREENLEVEL PLUS DIRECTION SHOULD GREENLEVEL EXCEED ONE HUNDRED: RESET GREENLEVEL TO ZERO SHOULD GREENLEVEL FALL BELOW ZERO: RESET GREENLEVEL TO ONE HUNDRED SHOULD THE BLUE BUTTON BE PRESSED: SET BLUELEVEL TO BLUELEVEL PLUS DIRECTION SHOULD BLUELEVEL EXCEED ONE HUNDRED: RESET BLUELEVEL TO ZERO SHOULD BLUELEVEL FALL BELOW ZERO: RESET BLUELEVEL TO ONE HUNDRED LIGHT UP RED COMPONENT OF RGBLED TO REDLEVEL LIGHT UP GREEN COMPONENT OF RGBLED TO GREENLEVEL LIGHT UP BLUE COMPONENT OF RGBLED TO BLUELEVEL DELAY EVER SO BRIEFLY KEEP GOING
To be successful in this project, the following criteria (or their equivalent) must be met:
Let's say you have completed work on the project, and are ready to submit, you would do the following (assuming you have a program called uom0.c):
lab46:~/src/SEMESTER/DESIG/PROJECT$ make submit
You should get some sort of confirmation indicating successful submission if all went according to plan. If not, check for typos and or locational mismatches.
I'll be evaluating the project based on the following criteria:
78:vcc2:final tally of results (78/78) *:vcc2:used grabit to obtain project by the Sunday prior to duedate [13/13] *:vcc2:picture of unpowered breadboard to #desig for approval [7/7] *:vcc2:picture of powered breadboard to #desig showing results [6/6] *:vcc2:clean compile, no compiler messages [7/7] *:vcc2:program conforms to project specifications [32/32] *:vcc2:code tracked in lab46 semester repo [13/13]