110 likes | 197 Views
Last week’s project demos. Servo control with photoresistor and enable/disable buttons Demo in class tonight – don’t start on the next project until I’ve seen this one!. More circuit design. Seven segment display. The Seven-segment Display. Nothing more that 8 LEDs in a single package
E N D
Last week’s project demos • Servo control with photoresistor and enable/disable buttons • Demo in class tonight – don’t start on the next project until I’ve seen this one!
More circuit design Seven segment display
The Seven-segment Display • Nothing more that 8 LEDs in a single package • Each LED can be turned on/off independent of all others
The Seven-segment Display • Like individual LEDs, each has a cathode and an anode leg • The anode of each LED is routed to its own pin on the package • All cathodes are connected together and routed to two pins on the package (choose one of the other)
Schematic • The schematic shows the part as seven separate LEDs (as expected)
Usage • Use them as seven separate LEDs • That is, for whatever you would normally use an LED for
Typical circuit schematic and layout • See chapter 7 for example code • It’s just a bunch of OUTH and PAUSE statements
Memory usage • So far we have been writing to individual pins on the Basic Stamp module • For the seven segment display it would be convenient to write to multiple pins at one time • The I/O pins are memory mapped to various PBASIC Word type instructions • INS, OUTS • These are broken down further to Byte type instructions • INL, INH, OUTL, OUTH (Low byte, High byte) • These are broken down further to Nibble type instructions • INA, INB, INC, IND, OUTA, OUTB, OUTC, OUTD • These are broken down further to Bit type instructions • IN0 – IN15, OUT0 – OUT15 • Utilizing these instructions will set the direction of the pin accordingly
Memory usage • Another instruction called DIRS (and all size variations) is available to set the directions of the I/O pins • We saw this earlier when we needed to “disconnect” an output pin • Set the bits to 0 for input direction • Set the bits to 1 for output direction • Default power up is input • This is useful when setting up to do I/O without actually doing the I/O operation
Homework • By changing the value of the capacitor the time decay can be altered • Book labs had you do this • For this assignment • Build RC circuits using both 0.1uF and 0.01uF capacitors to create 2 timers (select one resistor value) • Include a button to select one of the two timer s • Include debug statements to indicate timer decay • Use the bidirectional LED to indicate which timer is selected • Green – fast (short time decay) • Red – slow (long time decay) • Include a 7-segment display in your design in some creative way
Deliverables • Due next week • A functional description of the system • A state-machine diagram depicting the operation of the system • Source code • A schematic diagram of the circuit • A working demonstration on the Basic Stamp development board (in class)