Skip to content

Commit

Permalink
Finished assignment!
Browse files Browse the repository at this point in the history
  • Loading branch information
JVKran committed Oct 23, 2021
1 parent 543602d commit c88af79
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,3 @@ Two folders are particularly intresting. The [library folder](./lib) contains th
Click on the image to open YouTube!

[![Watch the video](https://i9.ytimg.com/vi_webp/1ZETlR-mb2E/mqdefault.webp?v=61740db2&sqp=CLSo0IsG&rs=AOn4CLBTOKiR-ExctfN_rtNrEvuOl56xaw)](https://youtu.be/1ZETlR-mb2E)

<!-- <figure class="video_container">
<iframe src="https://www.youtube.com/embed/1ZETlR-mb2E" frameborder="0" allowfullscreen="true"> </iframe>
</figure> -->
Binary file modified examples/reaction_meter/reaction.qws
Binary file not shown.
14 changes: 5 additions & 9 deletions examples/reaction_meter/reaction.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,7 @@ PROCESS(CLK_50)
state <= BTN_WAIT_2;
resp_time := tick / (F_CLK / 1000);
tick := 0;
END IF;

IF tick mod (DELAY_PER_LED / (1 + TO_INTEGER(HLF_SW))) = 0 THEN
ELSIF tick mod (DELAY_PER_LED / (1 + TO_INTEGER(HLF_SW))) = 0 THEN
-- Increment lit up leds with 1.
IF dir = 1 THEN
led_idx <= STD_LOGIC_VECTOR(UNSIGNED(led_idx) + 1);
Expand Down Expand Up @@ -193,8 +191,8 @@ PROCESS(CLK_50)
hundreds <= STD_LOGIC_VECTOR(TO_UNSIGNED((resp_time / 100) mod 10, hundreds'length));
thousands <= STD_LOGIC_VECTOR(TO_UNSIGNED(resp_time / 1000, thousands'length));

-- Shift visualized response time on ring.
IF resp_time <= high_score THEN
IF RESP_BTN = '0' AND resp_time <= high_score THEN
-- Shift visualized response time on ring.
high_score := resp_time;
tick := tick + 1;
IF tick >= DELAY_PER_LED AND led_rdy = '1' THEN
Expand All @@ -211,10 +209,8 @@ PROCESS(CLK_50)
led_rsft <= '0';
led_flsh <= '0';
END IF;
END IF;

-- Go to IDLE when button released and led is ready for shutdown.
IF RESP_BTN = '1' AND led_rdy = '1' THEN
ELSIF RESP_BTN = '1' AND led_rdy = '1' THEN
-- Go to IDLE when button released and led is ready for shutdown.
state <= IDLE;
led_lsft <= '0';
led_rsft <= '0';
Expand Down

0 comments on commit c88af79

Please sign in to comment.