2013-2014 TEI3M Circuit Mods

 

Perform the following hardware and/or software modifications to have the respective circuit exhibit the required behaviour. Be sure to confirm.

NOTE. The goal this year is to write great code, not simply code that works. Likewise, the build quality of your prototypes continues to command a premium as it did in Grade 10.

CIRC-01. Blinking LED.

  1. Day 1. Review the Blink code carefully. Retype the sketch from memory under the name BlinkMod within a folder entitled Arduino. Add comments.
  2. Modify the circuit resulting in a count that it twice as fast. Think about great programming style.
  3. Modify the circuit to have the pulse originate from a different pin.
  4. Modify the circuit to place control of the up/down counting under software direction.
  5. Day 2. Duplicate the Fritzing breadboard view shown to the right (click the image to enlarge if necessary) and save the file as NybbleCounter.fzz.
  6. With the 4516 BCD IC removed, it's up to the software alone to present the counting. Develop the Arduino sketch NybbleCounter.ino that counts up from 0 through 15 before rolling over to 0, continually.
  7. Day 3. With the Arduino software now performing the role of the 4516, we can accomplish the same result as last year's exam with only the 4511 BCD to 7-segment display driver, appropriate resistors, and a 7-segment display. Save your working NybbleCounter.ino sketch as BCDtoDisplay.ino and modify it to drive a breadboard setup similar to the following,

  8. Day 4. (Updated: Sep 20) The final modification of last year's exam is to drive the 7-segment display directly from the Arduino (with resistors of course). Clearly, you'll need to employ 7 digital pins.
    1. Create a sketch entitled SevenSegmentDisplay.
    2. Representing each decimal digit requires the code to light the correct combination of segments, A through G. Use a table similar to the one below to identify the correct segments for each digit.

      # A B C D E F G Binary Octal Hexadecimal
      0 1 1 1 1 1 1 0 B01111110 0176 0x7E
      1 0 1 1 0 0 0 0 B00110000 0060 0x30
      2 1 1 0 1 1 0 1 B01101101 0155 0x6D
      3                    
      4                    
      5                    
      6                    
      7                    
      8                    
      9                    

    3. Using the array declaration below, complete the remaining 7 constants in either binary, octal, or hexadecimal values for efficient storage and access.
      int segments [] = {B01111110,060,0x6D,?,?,?,?,?,?,?};
    4. Implement a function with the header below that is to be called to light the 7 segments for a single digit passed as a parameter,
      //This function lights the appropriate segments for the digit n
      void display(int n){
       ...
      }
      
      
    5. Complete and confirm your sketch, combining your own coding strategies with the best idea understand from here.
    6. The cyclical display in last year's exam eventually came to rest due to the discharging of RC1. Although you needn't pursue it now, you should consider how the code in your sketch might simulate this behaviour over a random duration.
    7. Finally, you should consider whether the Arduino is capable of meeting the power requirements of this task. In particular the current demands for each pin and the entire board in total. You also want to imagine how an Arduino could be used to drive multiple 7-segment displays.

CIRC-02. Multiple LEDs.