Using MPLAB XIDE, PIC18F1330, (microcontroller) create a program using assembly
ID: 2292362 • Letter: U
Question
Using MPLAB XIDE, PIC18F1330, (microcontroller) create a program using assembly language that includes interrups to produce 12 different combinations using 3 LED lights and 4 switches. A on and off switch to start and end the program and switches that correspond to each LED. Like a simon says game There will be 4 inputs and 4 outputs. The program includes 12 levels (the 3 LED's combinations). Each level will represent a different combination of the LEDs (i.e. red, blue, green). The player will then repeat the combinations by pressing the buttons connected to the LED's. If the player repeats the led sequence correctly, the code will branch to the next level (next led combination). If the user repeats the LED sequence incorrectly all LEDs will turn on, all LEDs will then clear and the game restarts. The code will branch back to the beginning. Delays and timers can be used as well 0Explanation / Answer
ANSWER :
The program using assembly language that includes inteeups to produce 12 different combinations using 3 LED lights and 4 switches. A on and off switch to start and end the programs and switches that correspond to each LED.
Code
ORG 0000h
;start. or loop
loop:
CLR P2.0 ; LED ON state.
CALL DELAY ; wait for a dolay time.
SETB P2 .0 ; LED OFF state .
CALL DELAY ; wait for a dolay time .
JMP loop ; go to start .
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.