Aingkaran Suppiah / Mbed 2 deprecated assignment3

Dependencies:   mbed MCP23017 mbed-rtos WattBob_TextLCD

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "header.h"
00002 /*
00003     Embedded Software: Assignment 3
00004     
00005     Description:
00006     
00007     
00008 
00009 
00010     Version 0.2 Aingkaran Suppiah
00011 */
00012 
00013 SDATA speed = SDATA();
00014 CARINFO info = CARINFO();
00015 SIMU_DATA sim = SIMU_DATA();
00016 
00017 
00018 
00019 MCP23017            *par_port; // pointer to 16-bit parallel I/O object **was = NULL
00020 WattBob_TextLCD     *display; // pointer to 2*16 chacater LCD object **was = NULL
00021 
00022 Thread thread_1;
00023 Thread thread_2;
00024 Thread thread_3;
00025 Thread thread_4;
00026 Thread thread_5;
00027 Thread thread_6;
00028 Thread thread_7;
00029 Thread thread_8;
00030 Thread thread_9;
00031 Thread thread_10;
00032 
00033 
00034 Mutex simuXS;
00035 Mutex speedXS;
00036 Mutex carstateXS;
00037 
00038 int main() {  
00039 
00040     // set up for the LCD
00041    
00042     par_port = new MCP23017(p9, p10, 0x40); // initialise 16-bit I/O chip
00043     
00044     display = new WattBob_TextLCD(par_port); // initialise 2*26 char display
00045     
00046     par_port->write_bit(1,BL_BIT); // turn LCD backlight ON
00047     
00048     
00049     thread_1.start(task1readbrake);
00050     thread_2.start(task2readaccel);
00051     thread_3.start(task3enginestate);
00052     thread_4.start(task4average);
00053     thread_5.start(task5brakeLED);
00054     thread_6.start(task6speedmonitor);
00055     thread_7.start(task7displayvalues); 
00056     thread_8.start(task8sidelights);
00057     thread_9.start(task9indLED);
00058     thread_10.start(taskXserialdump);
00059 
00060 
00061    
00062 
00063 
00064   
00065 while(1){
00066             
00067         }
00068 }