![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
All tasks complete
Dependencies: mbed MCP23017 mbed-rtos WattBob_TextLCD
header.h@4:27340b291c09, 2019-03-26 (annotated)
- Committer:
- aingks
- Date:
- Tue Mar 26 14:49:10 2019 +0000
- Revision:
- 4:27340b291c09
- Parent:
- 3:f88d667629e6
- Child:
- 5:f5dda79b93cb
the code compiles now, progressing towards tasks
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 | 3:f88d667629e6 | 5 | #include "WattBob_TextLCD.h" |
aingks | 3:f88d667629e6 | 6 | #include "rtos.h" |
aingks | 4:27340b291c09 | 7 | #include "MCP23017.h" |
aingks | 0:0943f040009c | 8 | |
aingks | 0:0943f040009c | 9 | #define pin_analog_1 p15 |
aingks | 0:0943f040009c | 10 | #define pin_analog_2 p16 |
aingks | 0:0943f040009c | 11 | |
aingks | 0:0943f040009c | 12 | #define pin_digital_1 p17 |
aingks | 0:0943f040009c | 13 | #define pin_digital_2 p18 |
aingks | 0:0943f040009c | 14 | #define pin_digital_3 p19 |
aingks | 0:0943f040009c | 15 | #define pin_digital_4 p20 |
aingks | 0:0943f040009c | 16 | |
aingks | 0:0943f040009c | 17 | #define pin_LED1 LED1 |
aingks | 0:0943f040009c | 18 | #define pin_LED2 LED2 |
aingks | 0:0943f040009c | 19 | #define pin_LED3 LED3 |
aingks | 0:0943f040009c | 20 | #define pin_LED4 LED4 |
aingks | 0:0943f040009c | 21 | #define pin_LED5 p25 |
aingks | 0:0943f040009c | 22 | #define pin_LED6 p26 |
aingks | 0:0943f040009c | 23 | |
aingks | 0:0943f040009c | 24 | |
aingks | 0:0943f040009c | 25 | |
aingks | 0:0943f040009c | 26 | |
aingks | 0:0943f040009c | 27 | //call the functions at the end for the main |
aingks | 0:0943f040009c | 28 | |
aingks | 0:0943f040009c | 29 | |
aingks | 0:0943f040009c | 30 | //STRUCTURE |
aingks | 0:0943f040009c | 31 | typedef struct |
aingks | 0:0943f040009c | 32 | { |
aingks | 0:0943f040009c | 33 | float brakevalue; |
aingks | 1:c4f62ef9b5b7 | 34 | float accelvalue; |
aingks | 0:0943f040009c | 35 | float array[5]; |
aingks | 0:0943f040009c | 36 | float average; |
aingks | 0:0943f040009c | 37 | float rawspeed; |
aingks | 0:0943f040009c | 38 | }SDATA; |
aingks | 0:0943f040009c | 39 | |
aingks | 0:0943f040009c | 40 | |
aingks | 0:0943f040009c | 41 | |
aingks | 4:27340b291c09 | 42 | |
aingks | 0:0943f040009c | 43 | |
aingks | 2:9d6d07c9cc9c | 44 | |
aingks | 0:0943f040009c | 45 | typedef struct |
aingks | 0:0943f040009c | 46 | { |
aingks | 2:9d6d07c9cc9c | 47 | int ENGINESTATE; |
aingks | 2:9d6d07c9cc9c | 48 | uint8_t odometer; |
aingks | 4:27340b291c09 | 49 | uint8_t leftind; |
aingks | 4:27340b291c09 | 50 | uint8_t rightind; |
aingks | 4:27340b291c09 | 51 | uint8_t sideind; |
aingks | 4:27340b291c09 | 52 | }CARINFO; |
aingks | 1:c4f62ef9b5b7 | 53 | |
aingks | 4:27340b291c09 | 54 | |
aingks | 0:0943f040009c | 55 | |
aingks | 4:27340b291c09 | 56 | typedef struct |
aingks | 4:27340b291c09 | 57 | { |
aingks | 4:27340b291c09 | 58 | float brakevalue; |
aingks | 4:27340b291c09 | 59 | float accelvalue; |
aingks | 4:27340b291c09 | 60 | float odometer; |
aingks | 4:27340b291c09 | 61 | float rawspeed; |
aingks | 4:27340b291c09 | 62 | |
aingks | 4:27340b291c09 | 63 | }SIMU_DATA; |
aingks | 3:f88d667629e6 | 64 | |
aingks | 4:27340b291c09 | 65 | |
aingks | 0:0943f040009c | 66 | |
aingks | 0:0943f040009c | 67 | |
aingks | 0:0943f040009c | 68 | //calling all functions |
aingks | 0:0943f040009c | 69 | |
aingks | 0:0943f040009c | 70 | void task1readbrake(); |
aingks | 0:0943f040009c | 71 | void task2readaccel(); |
aingks | 0:0943f040009c | 72 | void task3enginestate(); |
aingks | 0:0943f040009c | 73 | void task4average(); |
aingks | 0:0943f040009c | 74 | void task5brakeLED(); |
aingks | 0:0943f040009c | 75 | void task6speedmonitor(); |
aingks | 0:0943f040009c | 76 | void task7displayvalues(); |
aingks | 0:0943f040009c | 77 | void task8sidelights(); |
aingks | 0:0943f040009c | 78 | void task9indLED(); |
aingks | 0:0943f040009c | 79 | void taskXserialdump(); |
aingks | 0:0943f040009c | 80 | |
aingks | 0:0943f040009c | 81 | |
aingks | 0:0943f040009c | 82 | #endif |