All tasks complete
Dependencies: mbed MCP23017 mbed-rtos WattBob_TextLCD
header.h@3:f88d667629e6, 2019-03-25 (annotated)
- Committer:
- aingks
- Date:
- Mon Mar 25 21:13:24 2019 +0000
- Revision:
- 3:f88d667629e6
- Parent:
- 2:9d6d07c9cc9c
- Child:
- 4:27340b291c09
added the led code however ifndef is not working
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 <vector> |
aingks | 3:f88d667629e6 | 7 | #include "rtos.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 | 2:9d6d07c9cc9c | 40 | SDATA speed; |
aingks | 0:0943f040009c | 41 | |
aingks | 0:0943f040009c | 42 | |
aingks | 3:f88d667629e6 | 43 | typedef enum signallite{ }IND_TURN;//should be filled with the ind stuff i believe |
aingks | 0:0943f040009c | 44 | |
aingks | 2:9d6d07c9cc9c | 45 | |
aingks | 0:0943f040009c | 46 | typedef struct |
aingks | 0:0943f040009c | 47 | { |
aingks | 2:9d6d07c9cc9c | 48 | int ENGINESTATE; |
aingks | 2:9d6d07c9cc9c | 49 | uint8_t odometer; |
aingks | 1:c4f62ef9b5b7 | 50 | IND_TURN ind; |
aingks | 3:f88d667629e6 | 51 | }CARINFO;//finish this struct |
aingks | 1:c4f62ef9b5b7 | 52 | |
aingks | 1:c4f62ef9b5b7 | 53 | CARINFO info; |
aingks | 0:0943f040009c | 54 | |
aingks | 3:f88d667629e6 | 55 | // pointer to 16-bit parallel I/O object |
aingks | 3:f88d667629e6 | 56 | MCP23017 *par_port; |
aingks | 3:f88d667629e6 | 57 | |
aingks | 3:f88d667629e6 | 58 | // pointer to 2*16 chacater LCD object |
aingks | 3:f88d667629e6 | 59 | WattBob_TextLCD *lcd; |
aingks | 0:0943f040009c | 60 | |
aingks | 0:0943f040009c | 61 | |
aingks | 0:0943f040009c | 62 | //calling all functions |
aingks | 0:0943f040009c | 63 | |
aingks | 0:0943f040009c | 64 | void task1readbrake(); |
aingks | 0:0943f040009c | 65 | void task2readaccel(); |
aingks | 0:0943f040009c | 66 | void task3enginestate(); |
aingks | 0:0943f040009c | 67 | void task4average(); |
aingks | 0:0943f040009c | 68 | void task5brakeLED(); |
aingks | 0:0943f040009c | 69 | void task6speedmonitor(); |
aingks | 0:0943f040009c | 70 | void task7displayvalues(); |
aingks | 0:0943f040009c | 71 | void task8sidelights(); |
aingks | 0:0943f040009c | 72 | void task9indLED(); |
aingks | 0:0943f040009c | 73 | void taskXserialdump(); |
aingks | 0:0943f040009c | 74 | |
aingks | 0:0943f040009c | 75 | |
aingks | 0:0943f040009c | 76 | #endif |