![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
All tasks complete
Dependencies: mbed MCP23017 mbed-rtos WattBob_TextLCD
header.h@11:d6d1583fc824, 2019-03-27 (annotated)
- Committer:
- aingks
- Date:
- Wed Mar 27 13:41:38 2019 +0000
- Revision:
- 11:d6d1583fc824
- Parent:
- 9:2fd97246b8f0
- Child:
- 12:f4052a23ddc7
bugged code (retracing)
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 | 8:3f3f2c2e2046 | 6 | |
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 | 5:f5dda79b93cb | 25 | #define MAXSPEED 160 |
aingks | 5:f5dda79b93cb | 26 | #define SAMPLESIZE 5 |
aingks | 7:87f7ba90fdce | 27 | #define SPEEDLIMIT 88 |
aingks | 9:2fd97246b8f0 | 28 | |
aingks | 5:f5dda79b93cb | 29 | //FREQUENCIES |
aingks | 5:f5dda79b93cb | 30 | #define CLOCKFREQ 20 |
aingks | 6:abbd51d9b045 | 31 | #define TASKFREQ1 8 |
aingks | 6:abbd51d9b045 | 32 | #define TASKFREQ2 10 |
aingks | 6:abbd51d9b045 | 33 | #define TASKFREQ3 4 |
aingks | 6:abbd51d9b045 | 34 | #define TASKFREQ4 4 |
aingks | 6:abbd51d9b045 | 35 | #define TASKFREQ5 4 |
aingks | 6:abbd51d9b045 | 36 | #define TASKFREQ6 5 |
aingks | 6:abbd51d9b045 | 37 | #define TASKFREQ7 2 |
aingks | 6:abbd51d9b045 | 38 | #define TASKFREQ8 4 |
aingks | 6:abbd51d9b045 | 39 | #define TASKFREQ9 1 |
aingks | 6:abbd51d9b045 | 40 | #define TASKFREQ9S2 2 |
aingks | 6:abbd51d9b045 | 41 | #define TASKFREQX 0.5 |
aingks | 5:f5dda79b93cb | 42 | |
aingks | 5:f5dda79b93cb | 43 | |
aingks | 0:0943f040009c | 44 | |
aingks | 0:0943f040009c | 45 | |
aingks | 0:0943f040009c | 46 | //call the functions at the end for the main |
aingks | 0:0943f040009c | 47 | |
aingks | 0:0943f040009c | 48 | |
aingks | 0:0943f040009c | 49 | //STRUCTURE |
aingks | 0:0943f040009c | 50 | typedef struct |
aingks | 0:0943f040009c | 51 | { |
aingks | 0:0943f040009c | 52 | float brakevalue; |
aingks | 1:c4f62ef9b5b7 | 53 | float accelvalue; |
aingks | 0:0943f040009c | 54 | float array[5]; |
aingks | 0:0943f040009c | 55 | float average; |
aingks | 0:0943f040009c | 56 | float rawspeed; |
aingks | 0:0943f040009c | 57 | }SDATA; |
aingks | 0:0943f040009c | 58 | |
aingks | 0:0943f040009c | 59 | |
aingks | 0:0943f040009c | 60 | |
aingks | 4:27340b291c09 | 61 | |
aingks | 0:0943f040009c | 62 | |
aingks | 2:9d6d07c9cc9c | 63 | |
aingks | 0:0943f040009c | 64 | typedef struct |
aingks | 0:0943f040009c | 65 | { |
aingks | 8:3f3f2c2e2046 | 66 | int ENGINESTATE; |
aingks | 8:3f3f2c2e2046 | 67 | float odometer; |
aingks | 4:27340b291c09 | 68 | uint8_t leftind; |
aingks | 4:27340b291c09 | 69 | uint8_t rightind; |
aingks | 4:27340b291c09 | 70 | uint8_t sideind; |
aingks | 4:27340b291c09 | 71 | }CARINFO; |
aingks | 1:c4f62ef9b5b7 | 72 | |
aingks | 4:27340b291c09 | 73 | |
aingks | 0:0943f040009c | 74 | |
aingks | 4:27340b291c09 | 75 | typedef struct |
aingks | 4:27340b291c09 | 76 | { |
aingks | 4:27340b291c09 | 77 | float brakevalue; |
aingks | 4:27340b291c09 | 78 | float accelvalue; |
aingks | 4:27340b291c09 | 79 | float odometer; |
aingks | 4:27340b291c09 | 80 | float rawspeed; |
aingks | 4:27340b291c09 | 81 | |
aingks | 4:27340b291c09 | 82 | }SIMU_DATA; |
aingks | 3:f88d667629e6 | 83 | |
aingks | 4:27340b291c09 | 84 | |
aingks | 0:0943f040009c | 85 | |
aingks | 0:0943f040009c | 86 | |
aingks | 0:0943f040009c | 87 | //calling all functions |
aingks | 0:0943f040009c | 88 | |
aingks | 0:0943f040009c | 89 | void task1readbrake(); |
aingks | 0:0943f040009c | 90 | void task2readaccel(); |
aingks | 0:0943f040009c | 91 | void task3enginestate(); |
aingks | 0:0943f040009c | 92 | void task4average(); |
aingks | 0:0943f040009c | 93 | void task5brakeLED(); |
aingks | 0:0943f040009c | 94 | void task6speedmonitor(); |
aingks | 0:0943f040009c | 95 | void task7displayvalues(); |
aingks | 0:0943f040009c | 96 | void task8sidelights(); |
aingks | 11:d6d1583fc824 | 97 | //void task9indLED(); |
aingks | 11:d6d1583fc824 | 98 | //void taskXserialdump(); |
aingks | 0:0943f040009c | 99 | |
aingks | 0:0943f040009c | 100 | |
aingks | 0:0943f040009c | 101 | #endif |