User Tools

Site Tools


Sidebar

projects

pct0 (bonus; due 20230823)
wcp1 (due 20230823)
abc0 (due 20230830)
pct1 (bonus; due 20230830)
pct2 (due 20230830)
wcp2 (due 20230830)
gtf0 (due 20230906)
pct3 (bonus; due 20230906)
wcp3 (due 20230906)
dtr0 (due 20230913)
pct4 (due 20230913)
wcp4 (due 20230913)
pct5 (bonus; due 20230920)
stl0 (due 20230920)
wcp5 (due 20230920)
gfo0 (due 20230927)
pct6 (due 20230927)
stl1 (due 20230927)
wcp6 (due 20230927)
pct7 (bonus; due 20231004)
ptb0 (due 20231004)
wcp7 (due 20231004)
bwp1 (bonus; due 20231018)
pct8 (due 20231018)
ptb1 (due 20231018)
wcp8 (due 20231018)
pct9 (bonus; due 20231025)
ptb2 (due 20231025)
wcp9 (due 20231025)
eap0 (due 20231101)
gfo1 (due 20231101)
pctA (due 20231101)
wcpA (due 20231101)
pctB (bonus; due 20231108)
wcpB (due 20231108)
eap1 (due 20231109)
eap2 (due 20231115)
pctC (due 20231115)
wcpC (due 20231115)
bwp2 (bonus; due 20231129)
pctD (bonus; due 20231129)
wcpD (bonus; due 20231129)
gfo2 (due 20231206)
pctE (bonus; due 20231206)
wcpE (bonus; due 20231206)
EoCE (due 20231214)
haas:fall2023:c4eng:projects:sss0

Corning Community College

ENGR1050 C for Engineers

PROJECT: Simple Simon Says (SSS0)

OBJECTIVE

Create circuitry and code software to eventually craft a simple version of the classic “Simon” game of recalled repetition.

GRABIT

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

OVERVIEW

Your task is to design a circuit and write a program that:

  • has a passive buzzer that will play a song (over and over)
  • in your program, use an array to store the individual frequencies to be played, followed by a delay

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.

EDIT

You will want to go here to edit and fill in the various sections of the document:

BACKGROUND

For this project, we will be experimenting with sound to create a song. In this project we will learn what an active and passive buzzer is. An active buzzer has a built in oscillator to generate sound by itself with a DC (direct current) power supply. A passive buzzer does not have a built in oscillator to generate sound, instead it needs an AC (alternating current) audio signal to generate sound. In this project, we will be using a passive buzzer to create the sound that will be used to play the song we create.

ARRAYS

Arrays are a type of variable that contain a number of elements within it. An array can hold any number of elements, be they a variable or a value, provided that these elements are all of the same data type and the number of elements is a predetermined finite value.

The first element in an array has an index of 0, the second element has an index of 1, and so on. Declaring an array is done similarly, yet slightly differently, than that of other variables. With other variables, they might be declared like this:

int index = 0;

For this, “int” is the data type of the variable, “index” is its name, and “0” is its value, this we know.

For arrays, however, rather than declaring some sort of array data type, we instead declare the data type of the elements that will populate our array, appending square brackets to the end of the variable name to indicate an array, with a number within those brackets to signify the number of elements in, or size of, that array (no number means 0). Using vcc0 as an example:

int pin[NUM_PINS];

The name of this array is called “pin” and holds “NUM_PINS” number of elements, and the data type of those elements is “int”.

Both calling and assigning the value of an element within an array after the array has been declared is once again done similarly, yet slightly differently, than that of other variables. The only difference is that, for an array, the index of the element being assigned must be within square brackets appended to the end of the name of the array. Once again using vcc0 as an example, for assigning:

pin[2] = 3;

This will assign the third value (index = 2) of the array “pin” to have a value of “3”, provided that the array has a size of at least three elements.

ELECTRONICS

PARTS

A Passive buzzer is also known as Transducer, it uses AC power that is driven through an onboard circuit. The frequency is dependent on the input square wave signal, as it changes so does the frequency, hence offering more variance in its usage.

Transistors are electronic components that are used in circuits for either amplifying or switching electrical signals or power and allowing them to be used in a large array of electronic devices. A transistor has two PN diodes combined back to back. Also, it has three terminals named emitter, base, and collector. The fundamental idea and physical law behind a transistor are that it should let you control the flow of current over one channel by varying the intensity of a much smaller current flowing through another channel.

CIRCUIT

 

pseudocode

SET INDEX TO ZERO
AS LONG AS PROGRAM CONTINUES TO RUN:

    PLAY THE NOTE LOCATED AT THE CURRENT INDEX
    DELAY FOR THE LENGTH OF TIME AT CURRENT INDEX PLUS ONE
    SET THE INDEX TO GO UP BY TWO
    SHOULD THE INDEX EXCEED THE TOTAL NUMBER OF NOTE/FREQUENCY PAIRS:
        RESET INDEX TO ZERO

KEEP GOING

SUBMISSION

To be successful in this project, the following criteria (or their equivalent) must be met:

  • Project must be submit on time, by the deadline.
    • Late submissions will lose 33% credit per day, with the submission window closing on the 3rd day following the deadline.
  • All code must compile cleanly (no warnings or errors)
    • Compile with the -Wall and –std=gnu18 compiler flags
    • all requested functionality must conform to stated requirements (either on this document or in a comment banner in source code files themselves).
  • Executed programs must display in a manner similar to provided output
    • output formatted, where applicable, must match that of project requirements
  • Processing must be correct based on input given and output requested
  • Output, if applicable, must be correct based on values input
  • Code must be nicely and consistently indented
  • Code must be consistently written, to strive for readability from having a consistent style throughout
  • Code must be commented
    • Any “to be implemented” comments MUST be removed
      • these “to be implemented” comments, if still present at evaluation time, will result in points being deducted.
      • Sufficient comments explaining the point of provided logic MUST be present
  • No global variables (without instructor approval), no goto statements, no calling of main()!
  • Track/version the source code in your lab46 semester repository
  • Submit a copy of your source code to me using the submit tool (make submit on lab46 will do this) by the deadline.

Submit Tool Usage

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.

RUBRIC

I'll be evaluating the project based on the following criteria:

78:sss0:final tally of results (78/78)
*:sss0:used grabit to obtain project by the Sunday prior to duedate [13/13]
*:sss0:picture of unpowered breadboard to #desig for approval [7/7]
*:sss0:picture of powered breadboard to #desig showing results [6/6]
*:sss0:clean compile, no compiler messages [7/7]
*:sss0:program conforms to project specifications [32/32]
*:sss0:code tracked in lab46 semester repo [13/13]

Pertaining to the collaborative authoring of project documentation

  • each class member is to participate in the contribution of relevant information and formatting of the documentation
    • minimal member contributions consist of:
      • near the class average edits (a value of at least four productive edits)
      • near the average class content change average (a value of at least 256 bytes (absolute value of data content change))
      • near the class content contribution average (a value of at least 1kiB)
      • no adding in one commit then later removing in its entirety for the sake of satisfying edit requirements
    • adding and formatting data in an organized fashion, aiming to create an informative and readable document that anyone in the class can reference
    • content contributions will be factored into a documentation coefficient, a value multiplied against your actual project submission to influence the end result:
      • no contributions, co-efficient is 0.50
      • less than minimum contributions is 0.75
      • met minimum contribution threshold is 1.00

Additionally

  • Solutions not abiding by spirit of project will be subject to a 50% overall deduction
  • Solutions not utilizing descriptive why and how comments will be subject to a 25% overall deduction
  • Solutions not utilizing indentation to promote scope and clarity or otherwise maintaining consistency in code style and presentation will be subject to a 25% overall deduction
  • Solutions not organized and easy to read (assume a terminal at least 90 characters wide, 40 characters tall) are subject to a 25% overall deduction
haas/fall2023/c4eng/projects/sss0.txt · Last modified: 2022/09/26 21:02 by 127.0.0.1