![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
All tasks complete
Dependencies: mbed MCP23017 mbed-rtos WattBob_TextLCD
main.cpp@4:27340b291c09, 2019-03-26 (annotated)
- Committer:
- aingks
- Date:
- Tue Mar 26 14:49:10 2019 +0000
- Revision:
- 4:27340b291c09
- Parent:
- 3:f88d667629e6
- Child:
- 8:3f3f2c2e2046
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 | #include "header.h" |
aingks | 1:c4f62ef9b5b7 | 2 | /* |
aingks | 1:c4f62ef9b5b7 | 3 | Embedded Software: Assignment 3 |
aingks | 1:c4f62ef9b5b7 | 4 | |
aingks | 1:c4f62ef9b5b7 | 5 | Description: |
aingks | 1:c4f62ef9b5b7 | 6 | |
aingks | 1:c4f62ef9b5b7 | 7 | |
aingks | 0:0943f040009c | 8 | |
aingks | 0:0943f040009c | 9 | |
aingks | 3:f88d667629e6 | 10 | Version 0.2 Aingkaran Suppiah |
aingks | 1:c4f62ef9b5b7 | 11 | */ |
aingks | 1:c4f62ef9b5b7 | 12 | |
aingks | 4:27340b291c09 | 13 | SDATA speed = SDATA(); |
aingks | 4:27340b291c09 | 14 | CARINFO info = CARINFO(); |
aingks | 4:27340b291c09 | 15 | SIMU_DATA sim = SIMU_DATA(); |
aingks | 4:27340b291c09 | 16 | |
aingks | 4:27340b291c09 | 17 | |
aingks | 4:27340b291c09 | 18 | |
aingks | 4:27340b291c09 | 19 | MCP23017 *par_port = NULL; // pointer to 16-bit parallel I/O object |
aingks | 4:27340b291c09 | 20 | WattBob_TextLCD *display = NULL; // pointer to 2*16 chacater LCD object |
aingks | 4:27340b291c09 | 21 | |
aingks | 4:27340b291c09 | 22 | |
aingks | 4:27340b291c09 | 23 | |
aingks | 4:27340b291c09 | 24 | Mutex simuXS; |
aingks | 4:27340b291c09 | 25 | Mutex speedXS; |
aingks | 4:27340b291c09 | 26 | Mutex carstateXS; |
aingks | 0:0943f040009c | 27 | |
aingks | 3:f88d667629e6 | 28 | int main() { |
aingks | 3:f88d667629e6 | 29 | |
aingks | 3:f88d667629e6 | 30 | |
aingks | 3:f88d667629e6 | 31 | // set up for the LCD |
aingks | 4:27340b291c09 | 32 | |
aingks | 4:27340b291c09 | 33 | par_port = new MCP23017(p9, p10, 0x40); // initialise 16-bit I/O chip |
aingks | 4:27340b291c09 | 34 | display = new WattBob_TextLCD(par_port); // initialise 2*26 char display |
aingks | 3:f88d667629e6 | 35 | par_port->write_bit(1,BL_BIT); // turn LCD backlight ON |
aingks | 0:0943f040009c | 36 | |
aingks | 0:0943f040009c | 37 | |
aingks | 0:0943f040009c | 38 | |
aingks | 0:0943f040009c | 39 | } |