Challenge

Project 1 (Mini Project on Vehicle Direction Detection

Vehicle_Turn_Status_Subsystem :

Vehicle_Direction_Indicator_Subsystem :

SLDD :

As per MAAB guideline :

Report :

CODE :

/*
 * File: Project_on_Vehicle_Direction_Detection_1634144274.c
 *
 * Code generated for Simulink model 'Project_on_Vehicle_Direction_Detection_1634144274'.
 *
 * Model version                  : 1.13
 * Simulink Coder version         : 9.5 (R2021a) 14-Nov-2020
 * C/C++ source code generated on : Wed Jan 12 21:27:42 2022
 *
 * Target selection: ert.tlc
 * Embedded hardware selection: Intel->x86-64 (Windows64)
 * Code generation objectives: Unspecified
 * Validation result: Not run
 */

#include "Project_on_Vehicle_Direction_Detection_1634144274.h"
#include "Project_on_Vehicle_Direction_Detection_1634144274_private.h"

/* Exported data definition */

/* Definition for custom storage class: ExportToFile */
boolean_T Vehicle_Direction_Indicator; /* '/OR' */

/* Real-time model */
static RT_MODEL_Project_on_Vehicle_D_T Project_on_Vehicle_Direction_M_;
RT_MODEL_Project_on_Vehicle_D_T *const Project_on_Vehicle_Direction_M =
  &Project_on_Vehicle_Direction_M_;

/* Model step function */
void Project_on_Vehicle_Direction_Detection_1634144274_step(void)
{
  int32_T rtb_Vehicle_Turn_Status;

  /* Switch: '/Switch' incorporates:
   *  Constant: '/Left_Turn_AngularLimit'
   *  Constant: '/Right_Turn_AngularLimit'
   *  Inport: '/SteeringWheel_YawDegreeInput'
   *  Switch: '/Switch1'
   */
  if (SteeringWheel_YawDegreeInput > 25) {
    rtb_Vehicle_Turn_Status = 30;
  } else if (SteeringWheel_YawDegreeInput > 0) {
    /* Switch: '/Switch1' incorporates:
     *  Constant: '/Straight_Drive_Steering_Angle'
     */
    rtb_Vehicle_Turn_Status = 0;
  } else {
    rtb_Vehicle_Turn_Status = -120;
  }

  /* End of Switch: '/Switch' */

  /* Logic: '/OR' incorporates:
   *  Constant: '/LeftTurn_RoadSign'
   *  Constant: '/RightTurn_RoadSign'
   *  Constant: '/Straight_RoadSign'
   *  Inport: '/CameraInput_RoadSign'
   *  Logic: '/Logical Operator'
   *  Logic: '/Logical Operator1'
   *  Logic: '/Logical Operator3'
   *  RelationalOperator: '/Relational Operator'
   *  RelationalOperator: '/Relational Operator1'
   *  RelationalOperator: '/Relational Operator2'
   */
  Vehicle_Direction_Indicator = ((CameraInput_RoadSign &&
    (rtb_Vehicle_Turn_Status == 30)) || (CameraInput_RoadSign &&
    (rtb_Vehicle_Turn_Status == -120)) || (CameraInput_RoadSign &&
    (rtb_Vehicle_Turn_Status == 0)));
}

/* Model initialize function */
void Project_on_Vehicle_Direction_Detection_1634144274_initialize(void)
{
  /* (no initialization code required) */
}

/* Model terminate function */
void Project_on_Vehicle_Direction_Detection_1634144274_terminate(void)
{
  /* (no terminate code required) */
}

/*
 * File trailer for generated code.
 *
 * [EOF]
 */
Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.