![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
All tasks complete
Dependencies: mbed MCP23017 mbed-rtos WattBob_TextLCD
Diff: assignment3tasks.cpp
- Revision:
- 1:c4f62ef9b5b7
- Parent:
- 0:0943f040009c
- Child:
- 2:9d6d07c9cc9c
diff -r 0943f040009c -r c4f62ef9b5b7 assignment3tasks.cpp --- a/assignment3tasks.cpp Wed Mar 20 15:49:27 2019 +0000 +++ b/assignment3tasks.cpp Wed Mar 20 16:12:17 2019 +0000 @@ -9,9 +9,9 @@ //switches DigitalIn ngene(pin_digital_1); -DigitalIn leftind(pin_digital_2); -DigitalIn rightind(pin_digital_3); -DigitalIn sideonff(pin_digital_4); +DigitalIn leftsw(pin_digital_2); +DigitalIn rightsw(pin_digital_3); +DigitalIn sidesw(pin_digital_4); //indicators @@ -28,17 +28,33 @@ void task1readbrake() { - speedData.brakevalue = brake_pedal.read(); + //lock + speed.brakevalue = brake_pedal.read(); + //unlock } void task2readaccel() { - accelvalue = accel_pedal.read(); + //lock + speed.accelvalue = accel_pedal.read(); + //unlock } void task3enginestate() -{ - stateonoff = ngene.read(); +{ + //lock + + uint8_t engineonoff = ngene.read(); + info->ENGINESTATE = engineonoff;# + + //unlock + + if(engineonoff == 1){ + ngeneind = 1; + } + else{ + ngeneind = 0; + } } void task4average()