Turn Door uses an MxVMC to simulate a simple body control module. The main entry point of TurnDoor is void AppTask_5ms(void). This is located in App.c. MxVDev invokes this function every 5ms of simulated time.

There are four main features and four main functions:

door_lamp_handling(); //This code provides the logic for changing the intensity of the Dome Lamp based on when the doors are opened.


turn_lamp_handling(); //This code flashes the indicators based on the position of the left and right turn switches.


Odo_Update(); //This code is responsible for incrementing the odometer (distance traveled) based on the speed of the vehicle.


LCD_Update(); //This code provides the logic for the scrolling marquee that displays 'MicroMax' in the driver information center.


You can experiment to see how the code behaves as follows:

1.Open the Scenario called InteractiveBackgroundScenario.mxs.

2.Open the Interactive Test Panel called InteractiveTest1.

3.On the toolbar set the Clock Source to RT Clock. The tortoise (ToolbarButtonSwitchRTClock) should be visible. See Real Time/Accelerated Time.

4.Click the Run button, and experiment with the controls in the interactive test panel.

You may need to use the MSVS conversion wizard and convert the solution to run the sample.


Related Topics:

Getting Started with the Invert Sample (a simple VMC)

Sample Projects

MxVMC - The Virtual MicroController