This is an old revision of the document!


L1 Digital i/o

Digital board's demo/test program: basic_v3.1_test.hex. The program can be used to test if the board is in working order.

Digital i/o

Write the program that …

  1. … when pressing switch 1 (S1), LED 2 lights on; continue, doing the same with S2 ⇒ LED 3 and S3 ⇒ LED 1. (SOLUTION)
  2. … simulates the traffic light sequence on LEDs (green blinking, etc.) (SOLUTION)
  3. … counts the button pressed and showing it on LED as binary code. Max 7(23-1). (Pressing is counted only then when it is released) (SOLUTION)
  4. … simulates door code lock. When pressing switches in this order S3 – S2 - S1 green LED goes on. All other combination will end up red LED. Every button pressing is indicated with yellow LED.(SOLUTION) .
  5. … simulates memory game. Every LED corresponds a button (LED1⇒S1, etc.) Controller flashed LEDs in random order and user have to repeat this order. Every next step in the sequence goes longer. After every insertion controller test the result. If wrong insertion is detected the game is over and result is presented to the user (on the 7-seg display or LCD).(SOLUTION).
  6. … measures reaction time. Program start when one button is pressed, then a LED goes on and user have to press a button under the LED. Sequence and time when LED goes on is random. Best result in milliseconds is presented to the user (on the 7-seg display or LCD).(SOLUTION).

Timers

Write the program that …

  1. … flashes LEDs with different frequency using timer. Frequency can be changed by the buttons. (S1 – 1 Hz, S2 – 0,5 Hz, S3 – 0,1 Hz).(SOLUTION).
  2. … flashes LEDs with different frequency using timer. S1 increases flashing frequency and S3 decreases.(SOLUTION).

7-seg number indicator

Write the program that …

  1. … counts numbers on 7-seg display from 1 to 9. If button S1 is pressed the counting starts to go backward. If S3 is pressed the counting resumes to go forward. Digit change frequency is 1 second.(SOLUTION).
en/exercises/digi.1253889129.txt.gz · Last modified: 2020/07/20 09:00 (external edit)
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0