All tasks complete

Dependencies:   mbed MCP23017 mbed-rtos WattBob_TextLCD

assignment3tasks.cpp

Committer:
aingks
Date:
2019-03-20
Revision:
0:0943f040009c
Child:
1:c4f62ef9b5b7

File content as of revision 0:0943f040009c:

#include "header.h"
//definitions of taskss
//lock and unlock variables in struct whne performing calculations 

//pedals 
AnalogIn            brake_pedal(pin_analog_1);
AnalogIn            accel_pedal(pin_analog_2);


//switches
DigitalIn           ngene(pin_digital_1);
DigitalIn           leftind(pin_digital_2);
DigitalIn           rightind(pin_digital_3);
DigitalIn           sideonff(pin_digital_4);


//indicators 
DigitalOut          ngeneind(pin_LED1);
DigitalOut          leftind(pin_LED2);
DigitalOut          rightind(pin_LED3);
DigitalOut          sideind(pin_LED4);


//RED box lights
DigitalOut          brakeind(pin_LED5);
DigitalOut          overspeedind(pin_LED6);


void task1readbrake()
{
   speedData.brakevalue = brake_pedal.read(); 
}

void task2readaccel()
{
   accelvalue = accel_pedal.read(); 
}

void task3enginestate()
{
    stateonoff = ngene.read();   
}

void task4average()
{
    
}