28123 Parallax Inc, 28123 Datasheet - Page 108

TEXT WHAT'S A MICROCONTROLLER

28123

Manufacturer Part Number
28123
Description
TEXT WHAT'S A MICROCONTROLLER
Manufacturer
Parallax Inc
Type
Programmingr
Datasheet

Specifications of 28123

Style
Book
Title
What's a Microcontroller?
Contents
Whats a Microcontroller? Text
Product
Microcontroller Accessories
Core Processor
PIC16C57c
Flash
128 Bytes
Operating Supply Voltage
9 V
Board Size
31 mm x 16 mm
Lead Free Status / RoHS Status
Not applicable / Not applicable
P15
P14
Snippets from the solution program are included below, but keep in mind
solutions may be coded a variety of different ways. However, most solutions
will include the following modifications:
Use two variables to keep track of two player's times.
timeCounterA VAR
timeCounterB VAR
Change instructions to reflect two pushbuttons:
DEBUG "Press and hold pushbuttons", CR,
DEBUG "buttons down again.", CR, CR
Wait for both buttons to be pressed before turning LED red, by using the
operator.
LOOP UNTIL (IN3 = 1) AND (IN4 = 1)
Wait for both buttons to be released to end timing, again using the
LOOP UNTIL (IN3 = 0) AND (IN4 = 0)
Add logic to decide which player's time is incremented.
IF (IN3 = 1) THEN
timeCounterA = timeCounterA + 1
ENDIF
IF (IN4 = 1) THEN
timeCounterB = timeCounterB + 1
ENDIF
Change time display to show times of both players.
DEBUG "Player A Time:
Add logic to show which player had the faster reaction time.
IF (timeCounterA < timeCounterB) THEN
470 Ω
DEBUG "Player B Time:
1
2
P4
Word
Word
", DEC timeCounterA, " ms. ", CR
220
", DEC timeCounterB, " ms. ", CR, CR
Vss
' Time score of player A
' Time score of player B
10
kΩ
Vdd
P3
220
AND
Vss
10
operator.
kΩ
AND
Vdd

Related parts for 28123