next up previous
Next: In-lab Tasks: Up: Tasks Previous: Tasks

Pre-lab Tasks:

  1. Design a button circuit that changes the state of input pin PA0 on the MicroStamp11. Draw a labelled schematic diagram for your circuit and draw a picture showing how you plan to layout the circuit component on your breadboard. Explain how button circuit works.
  2. Design a C-language program that waits for the input on pin PA0 to transition from low to high, increments an unsigned integer variable upon detecting the transition, and then writes out the value of the variable to the PC's terminal program after each low-to-high transition. Include program listing and explanation of how the program works.
  3. Design the 7-segment LED circuit so that a segment in the display can be turned on or off by using a single call to either the clear_pin() or set_pin() kernel functions. Draw a labelled schematic for your circuit and draw a picture showing the layout of circuit components on your breadboard. You should arrange your breadboard layout so the LED display is in the upper righthand corner of the breadboard. In your lab book include the schematic diagram and breadboard layout. Also provide an explanation of of how the LED circuit works.
  4. Write a C-language function that accepts an integer between 0 and 9 as input and then uses the clear_pin and set_pin kernel functions to display that digit on your LED display. A partial example of such a function is provided below.
    void display_digit(int data){
      int i;
    
      for(i=1;i<8;i++) set_pin(i);
      switch (data){
        case 0:
          clear_pin(1);clear_pin(2);clear_pin(3);
          clear_pin(4);clear_pin(5);clear_pin(6);
          break;
        case 1:
          clear_pin(2);clear_pin(3);
          break;
      }
    }
    
    This function accepts the integer data and sets the appropriate pins on the 7 segment LED display to show either a 0 or 1. Include a listing of your final function in your lab book and discuss how the program works.


next up previous
Next: In-lab Tasks: Up: Tasks Previous: Tasks
Michael Lemmon 2009-02-01