![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
All tasks complete
Dependencies: mbed MCP23017 mbed-rtos WattBob_TextLCD
header.h@2:9d6d07c9cc9c, 2019-03-20 (annotated)
- Committer:
- aingks
- Date:
- Wed Mar 20 19:51:42 2019 +0000
- Revision:
- 2:9d6d07c9cc9c
- Parent:
- 1:c4f62ef9b5b7
- Child:
- 3:f88d667629e6
added mutex and included the mbed-rtos library
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
aingks | 0:0943f040009c | 1 | #ifndef HEADER_whatever |
aingks | 0:0943f040009c | 2 | #define HEADER_whatever |
aingks | 0:0943f040009c | 3 | |
aingks | 0:0943f040009c | 4 | #include "mbed.h" |
aingks | 0:0943f040009c | 5 | |
aingks | 0:0943f040009c | 6 | |
aingks | 0:0943f040009c | 7 | #define pin_analog_1 p15 |
aingks | 0:0943f040009c | 8 | #define pin_analog_2 p16 |
aingks | 0:0943f040009c | 9 | |
aingks | 0:0943f040009c | 10 | #define pin_digital_1 p17 |
aingks | 0:0943f040009c | 11 | #define pin_digital_2 p18 |
aingks | 0:0943f040009c | 12 | #define pin_digital_3 p19 |
aingks | 0:0943f040009c | 13 | #define pin_digital_4 p20 |
aingks | 0:0943f040009c | 14 | |
aingks | 0:0943f040009c | 15 | #define pin_LED1 LED1 |
aingks | 0:0943f040009c | 16 | #define pin_LED2 LED2 |
aingks | 0:0943f040009c | 17 | #define pin_LED3 LED3 |
aingks | 0:0943f040009c | 18 | #define pin_LED4 LED4 |
aingks | 0:0943f040009c | 19 | #define pin_LED5 p25 |
aingks | 0:0943f040009c | 20 | #define pin_LED6 p26 |
aingks | 0:0943f040009c | 21 | |
aingks | 0:0943f040009c | 22 | |
aingks | 0:0943f040009c | 23 | |
aingks | 0:0943f040009c | 24 | |
aingks | 0:0943f040009c | 25 | //call the functions at the end for the main |
aingks | 0:0943f040009c | 26 | |
aingks | 0:0943f040009c | 27 | |
aingks | 0:0943f040009c | 28 | //STRUCTURE |
aingks | 0:0943f040009c | 29 | typedef struct |
aingks | 0:0943f040009c | 30 | { |
aingks | 0:0943f040009c | 31 | float brakevalue; |
aingks | 1:c4f62ef9b5b7 | 32 | float accelvalue; |
aingks | 0:0943f040009c | 33 | float array[5]; |
aingks | 0:0943f040009c | 34 | float average; |
aingks | 0:0943f040009c | 35 | float rawspeed; |
aingks | 0:0943f040009c | 36 | }SDATA; |
aingks | 0:0943f040009c | 37 | |
aingks | 2:9d6d07c9cc9c | 38 | SDATA speed; |
aingks | 0:0943f040009c | 39 | |
aingks | 0:0943f040009c | 40 | |
aingks | 1:c4f62ef9b5b7 | 41 | typedef enum signallite{ }IND_TURN; |
aingks | 0:0943f040009c | 42 | |
aingks | 2:9d6d07c9cc9c | 43 | |
aingks | 0:0943f040009c | 44 | typedef struct |
aingks | 0:0943f040009c | 45 | { |
aingks | 2:9d6d07c9cc9c | 46 | int ENGINESTATE; |
aingks | 2:9d6d07c9cc9c | 47 | uint8_t odometer; |
aingks | 1:c4f62ef9b5b7 | 48 | IND_TURN ind; |
aingks | 1:c4f62ef9b5b7 | 49 | }CARINFO; |
aingks | 1:c4f62ef9b5b7 | 50 | |
aingks | 1:c4f62ef9b5b7 | 51 | CARINFO info; |
aingks | 0:0943f040009c | 52 | |
aingks | 0:0943f040009c | 53 | |
aingks | 0:0943f040009c | 54 | |
aingks | 0:0943f040009c | 55 | //calling all functions |
aingks | 0:0943f040009c | 56 | |
aingks | 0:0943f040009c | 57 | void task1readbrake(); |
aingks | 0:0943f040009c | 58 | void task2readaccel(); |
aingks | 0:0943f040009c | 59 | void task3enginestate(); |
aingks | 0:0943f040009c | 60 | void task4average(); |
aingks | 0:0943f040009c | 61 | void task5brakeLED(); |
aingks | 0:0943f040009c | 62 | void task6speedmonitor(); |
aingks | 0:0943f040009c | 63 | void task7displayvalues(); |
aingks | 0:0943f040009c | 64 | void task8sidelights(); |
aingks | 0:0943f040009c | 65 | void task9indLED(); |
aingks | 0:0943f040009c | 66 | void taskXserialdump(); |
aingks | 0:0943f040009c | 67 | |
aingks | 0:0943f040009c | 68 | |
aingks | 0:0943f040009c | 69 | #endif |