Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time

The Final (in class) Project

In Car Safety system

  • We have a working Accelerometer
  • We have LED's and outputs
  • Lets make a "Real world" system

In Car Safety System Brief:

  • To promote safe driving we aim to detect reckless behaviour
    • To do this we use accelerometer to measure excessive force
    • Feedback to driver to show if they are unsafe
    • Keep Track of Maximum values for reporting

Sampling

  • A Thread to read from the Accerlomter
  • Sample at ??Hz
  • Take a rolling average of the readings for a Second
    • X,Y,Z, Roll and Yaw
  • Keep track of the Min and Max Values

Reporting

  • We have no CAN transevers, so we will Fake it with Serial.
  • Every Second, Report the Min, Max, and Avrage Values.

Safety System

  • Three Levels
    • Safe: One LED in the Direction of Travel
    • Warning: Blink LED in Direction of Travel
    • Danger: Blink ALL Leds, Sound Buzzer or Similar

User Input

  • Button to access "Debugging" Mode,
    • Output over Serial every time a sample is taken

Step 1: Desiging the system

  • What are good canditates for Threads?
  • What are good candidates for Events?
  • Do we need any objects to store data?

Step 2: Design the Logic

  • For each Thread / Event / Object
    • Quick pen and paper Sketch of how the information flow takes place.

Step 3: Implement "Teh Codez"

  • Working in "Logical Chunks"
    • Implement and Test each bit of functionality
    • Functional Testing. Does it work as Expected.