Premium Essay

Atmega3220 Unit 3 Game Analysis

Submitted By
Words 695
Pages 3
Summary:
This game test reaction time of two players, and declare the fastest one as winner. To do this I am using external interrupts and pin change interrupts in atmega328p. It gives four chance to each play, time of each chance is summed up and then player with minimum time is declared as the winner.
For the demo purpose, I’ll be using pseudo random function in it, just to keep track.
This game has precision of 1ms and accuracy of about +/- 4ms.
It also displays the concept of debouncing.
This game’s main motive is to show the beauty of external interrupts over polling and to show the how to reduce debouncing effect using software modifications.

How it is played:

My project is inspired from fastest finger first game.
In which there are …show more content…
All source code files and libraries along with headers are there in codes.zip. Place all of them in same directory and run the above commands.

What are External Interrupts:
External interrupts are very useful to interact with physical world, because of its unpredictable nature.
There are two ways of sensing data from different pins, one is polling other is using interrupts. Both polling and interrupts have pros and cons associated with them.
In polling you check status of each and every pin in a sequential manner: pros: Everyone one gets a fair chance cons: Inefficient, can’t do some other activity in between, specially have to go and check
Loss of data might occur in an unpredictable scenario.

Whereas, in interrupts you let your microcontroller do some other important stuff and whenever an interrupt is generated you stop the normal working of microcontroller and change its behavior accordingly. pros: Efficient, can do some other work in between
No loss of data cons: Extra resources on hardware level are

Similar Documents