Unit 6 Microcontroller Exam - Program Plan for Taxi Calculator
Introduction
- Purpose: Guide on creating a program plan for a microcontroller exam focused on a taxi fare calculator.
- Context: Part of Activity 3 in the BTEC Level 3 Extended Diploma in Engineering.
Activity Overview
- Objective: Develop a plan detailing the program structure and key system operations.
- Activity 3 Focus: Hardware design and connectivity have been covered; now focus on program planning.
Importance of Planning
- Why Plan?: Prevents complexities and errors during actual programming.
- What to Include: Flowchart or pseudocode showing program flow and operations.
- Outcome: A clear roadmap for programming in Activity 4.
Creating the Program Plan
- Flowchart as a Tool: Suggested method for drafting the program structure.
- Alternative: Pseudocode is acceptable if preferred.
- Structure: Aim for 15-20 blocks for clarity.
- Software Options: PowerPoint or Publisher recommended for creating flowcharts.
- PowerPoint Tips:
- Use custom slide size (A4) for better layout.
- Utilize flowchart shapes (e.g., terminators for start/end).
- Use control and shift keys for resizing and alignment.
Example Walkthrough
- Initial Setup:
- Start with a rounded edge block for 'Start'.
- Add blocks for each step in the taxi fare process.
- Flow Process:
- Journey initiation by user.
- Initial fare setup (£1.50 added to total).
- Counter starts to count to 20 seconds.
- Decision Points:
- Use diamond shapes for decisions (e.g., button pressed).
- Handle actions like pausing, stopping, or adding/subtracting fare based on button presses.
- Repetitive Loops:
- System checks repeatedly for button presses or countdown completion.
- Actions like adding 25p to fare every 20 seconds should loop appropriately.
- End of Journey:
- Stop the counter, ask about surcharges or discounts.
- Adjust fare and display the final fare.
- Completion:
- Return to start for the next journey.
Additional Notes
- Unexpected Events Handling: Include a section for handling unexpected events (e.g., incorrect button presses).
- Integration: Save flowchart as an image and insert into the workbook to maintain format.
Conclusion
- Summary: This plan outlines the preparation work for programming in Activity 4.
- Follow-up: The next step will be actual programming, discussed in subsequent videos.
By following the guide above, students can effectively prepare a plan for their microcontroller project, ensuring a structured and clear approach to the programming task ahead.