0% found this document useful (0 votes)
18 views

Homework #4 - 7 Segment Display Drawing

This document provides instructions for Homework #4 which involves using a joystick to control the position of a segment and "draw" on a 7 segment display. Students will use the joystick to move between neighboring segments on the display. Short pressing the button toggles a segment on/off, while long pressing resets the display. The coding task must have clean code without delays and use interrupts for bonus points. Students must publish their code and a video demonstration on GitHub for grading.

Uploaded by

Florin Vatau
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

Homework #4 - 7 Segment Display Drawing

This document provides instructions for Homework #4 which involves using a joystick to control the position of a segment and "draw" on a 7 segment display. Students will use the joystick to move between neighboring segments on the display. Short pressing the button toggles a segment on/off, while long pressing resets the display. The coding task must have clean code without delays and use interrupts for bonus points. Students must publish their code and a video demonstration on GitHub for grading.

Uploaded by

Florin Vatau
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Introduction to Robotics: Homework

Andrei Dumitriu [email protected]


Last Updated: October 30th, 2023, 13:20

1 Homework #4 - 7 segment display drawing


Deadline (hard): Your respective lab in the week of October 6th -
November 12th, 2023. You must have the Git ready and the assign-
ment turned in before the start of lab.

• General description: You will use the joystick to control the position of
the segment and ”draw” on the display. The movement between segments
should be natural, meaning they should jump from the current position
only to neighbors, but without passing through ”walls”.

• Example video: https://www.youtube.com/watch?v=03NsXO1_Q_4


• Components: 1 7-segment display, 1 joystick, resistors and wires (per
logic)
• Requirement: The initial position should be on the DP. The current
position always blinks (irrespective of the fact that the segment is on or
off). Use the joystick to move from one position to neighbors (see table for
corresponding movement). Short pressing the button toggles the segment
state from ON to OFF or from OFF to ON. Long pressing the button
resets the entire display by turning all the segments OFF and moving the
current position to the decimal point. Interrupts are required for CTI
and bonus for Computer Science.
Be careful:
1. Joystick movements should be done with toggle, as in the lab (joy-
Moved, etc)
2. For CTI, it is part of requirement to use interrupts. For Computer
Science, it is a bonus.
3. The code in the lab for joystick movement is not perfect and can
be improved. The code should be wrapped in a function and the
constraint between 0 and 9 can be simplified.

1
Unibuc Robotics 2022 - 2023

Current segment UP DOWN LEFT RIGHT


a N/A g f b
b a g f N/A
c g d e dp
d g N/A e c
e g d N/A c
f a g N/A b
g a d N/A N/A
dp N/A N/A c N/A

• Publishing task: You must add the code to the Github repo and continue
updating the readme with at least the following details (but feel free to
be more creative). I recommend using dropdowns in the readme, for each
project, if you feel the readme is too cluttered:
https://gist.github.com/citrusui/07978f14b11adada364ff901e27c7f61
1. Task Requirements
2. Picture of the setup
3. Link to video showcasing functionality (I recommend youtube, but
anything I can access is fine)
4. Remember to publish the video in the correct orientation. Don’t do
this: https://youtu.be/Y8H0PlUtcto
5. Hand in the homework on MS teams when done - aka when
Git is up to date

• Coding task: Coding style is of utmost importance. You must have a


perfectly clean code in order to receive the maximum grade. An important
coding challenge present in this task is using millis() or micros() and
interrupts instead of delay(). Do not use repetitive structures such as
while(). You can use for() in certain cases where it removes repeated
code (such as addressing all the segments, changing the pinMode() etc.).
However, remember that the bulk of the grade is if the projects works.
Do not tend to small details unless you have the entire functionality done.
• Possible bonus points:
– Add other components, such as sounds, other LEDs etc. Be creative.
– Computer Science students, you can use interrupts for bonus. For
CTI it is part of the basic requirement. Make sure you use it correctly.
It’s best to have a functional homework without interrupts rather
than one with interrupts that does not work.

Introduction to Robotics Homework #4

You might also like