28905 Parallax Inc, 28905 Datasheet - Page 8

no-image

28905

Manufacturer Part Number
28905
Description
Interface Modules & Development Tools AVRSimon Game Kit
Manufacturer
Parallax Inc
Datasheet

Specifications of 28905

Lead Free Status / RoHS Status
Lead free / RoHS Compliant
The game itself is comprised of two core functions, simon_play_moves() and simon_read_moves():
simon_play_moves() first pulls a number
from rand(), a linear feedback shift register
used as a pseudo-random number generator
(http://en.wikipedia.org/wiki/PRNG),
which
is seeded at the beginning of each game
with the current value of the Timer 1
counter and whatever pushbutton was
pushed to start the game, and limits the
result from ‘0’ to ‘3’ (corresponding to one of
the four possible LED colors on AVRSimon).
The number is then stored in U1’s internal
EEPROM (Electrically Erasable Programmable
Read-Only Memory), a non-volatile storage
container with individual byte addressing, at
the memory address equal to the current
length of the sequence. The game then
plays the entire sequence that is currently in
its EEPROM, contiguously from address 0
until the end of the sequence is reached. For
more details on EEPROM handling, see the
web address at the bottom of this page.
The
game
then
enters
the
simon_read_moves() routine, which waits
for the player to begin replaying the
sequence. For each move in the sequence,
the corresponding address of the EEPROM is
read and compared with the player’s input.
If the values do not match, then the player
must have pushed the wrong button and the
game will end via the simon_failed_input()
function. If the values do match, then the
player pushed the correct button and the
game proceeds to the next move in the
sequence. If the player successfully repeats
the entire sequence, the game jumps back
to simon_play_moves() to add another
move to the sequence and repeat the
process until the game is over.
http://www.nongnu.org/avr-libc/user-manual/group__avr__eeprom.html
Copyright © Parallax Inc.
AVRSimon Game Kit (#28905)
v1.0 3/22/2010 Page 8 of 10

Related parts for 28905