Thread: Exercise

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    3
    Rep Power
    0

    Exercise


    Hello, I am pretty new to the 'C' programming language and I have received a task to complete from school. If someone could help me or explain how to do I would be very great full.
    Here is the task:

    Toy Police Car Light System
    You are a design engineer for LIGO, a construction toy manufacture. The company wants to place electronic modules into a new range of toys to help boost sales. Your management have set you the task of designing the software for a Police car light system which will be used in the Police Car model pack.

    The electronic module consists of a toggle switch, a blue and a red LED and a low-cost microcontroller. The design brief requires that the blue and red LED's are lit alternately on a 1 second basis. The light sequence should be started and stopped using the toggle switch. In addition, management have requested that the software is portable so that it might be used on other modules with differing switch and LED arrangements. This WILL require the use of functions.

    You are to use the CityBytes blue and red LED's to provide the Police car light sequence. The PORTB[*] dip-switch should be used as the toggle switch. The program MUST contain the following:
    - LED and switch control implemented via function call.
    - At least one conditional statement.
    - An iterative loop.

    To successfully complete this exercise you are required to produce a written report with the following:
    - A Flow Chart or Algorithm documenting program operation.
    - A Program listing incorporating the problem definition, your details and comments to show program functionality.
    - A Test Plan with results recorded.
  2. #2
  3. Contributed User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jun 2005
    Posts
    4,381
    Rep Power
    1871
    Perhaps you can start with this
    My guess is you'll need a 'diamond' with something like 'is switch on?'
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper

IMN logo majestic logo threadwatch logo seochat tools logo