Monorail emulator
- 6 feb 2018
- 2 Min. de lectura
In the course Microprocessors and Interfacing at University of New South Wales, Sydney, my classmate Unai Aguilera and I programmed a monorail emulator using assembly code in Atmel Studio. The purpose of the program was to emulate a monorail using an Arduino Board with the AVR microprocessor ATMEGA2560.
Our program has to handle with the following peripherals: LCD, 4x4 keypad, DC motor, interrupts (buttons), LED's.
Basically, the what the program does is to:
Store the names of all the stations the user introduces with a 4x4 keypad. Therefore, a way of generating all the letters of the alphabet with the limited number of keys is implemented.
Store the travelling times between stations that the user introduces with the same keypad.
Store the desired stop time at the stations introduced by the user
The simulation part starts. The program displays in the LCD the time left to arrive to the following station. When the train is travelling, an electric motor runs at 60 rpm (using a PWM wave). When the train arrives at a station, the motor stops.
The train will stop at a station only if a passenger requires it (the user presses the buttons PB0 or PB1)
There is an emergency stop button (the # key). If the user presses it, the train will stop automatically until it is pressed again.
Whenever the monorail stops, 2 LED's blink at a frequency of 3 Hz.
For more details, please read the user manual we ellaborated: User Manual
If you want to have a look at the code, here it is: Monorail Emulator Code
The design manual explaining the control flow, functions, Macros and Data Structures use is contained in this file: Design Manual







Comentarios