assign4 - NET3001 Fall 10 Assignment 4 Due Oct 28 6pm...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
NET3001 Fall 10 Assignment 4 Due : Oct 28, 6pm Submitting : Use the submit.exe program. The files should be named assign41.c assign42.c You may include other files as well, if you have build libraries. Your library should include the *.c file and the matching *.h file. Overview: We are going to write some code to implement a controller for operating a combination lock. A classic high-school locker combination lock is operated by spinning a single wheel to 3 consecutive numbers, using a specific pattern. If the correct pattern and numbers are used, the lock will open. For example, if the numbers range from 0...11, and the lock sequence is 4,5,6, then the following operation will open the lock: spin the dial two full turns clockwise, then continue to the digit 4 (first digit) spin the dial counterclockwise, one complete revolution, passing the 4; continue to the 5 (2 nd digit) spin the dial clockwise, until you reach the 6 (3 rd digit) Part 1 of this assignment will simulate a machine that tests combination locks. Part 2 is a game, based on the same idea; it uses almost all the same code. All the code should be written in C and built to run on the MTS board. Use interrupt techniques for managing the time. You may use interrupt techniques for the keyboard (optional). Use the motor library you developed in lab 6. Part 1 Electronic Lock Tester (15 marks, assign41.c) The system operates as follows: at the beginning of a test sequence, the user adjusts the arrow on the stepper motor to point straight up (12 o'clock, 0 in our number system) the user then hits the “code” button and enters 3 digits, from 0 to 11 the system then pauses for 1 second the stepper motor begins to spin in the pattern required to operate the combination lock; the system issues a beep and a short pause when the stepper motor reaches each target number Write the code to implement this system. Arrange for the system to continuously repeat the 0 11 1 10 2 9 3 8 4 7 5 6
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
above sequence. Stepper Control As you have discovered, the stepper motor has 20 steps per revolution. But this project requires 12 positions on the circle. How do we decide how many steps are required to get to each target?
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern