el15mh 200929957

Dependencies:   mbed

Committer:
el15mh
Date:
Thu May 04 17:39:23 2017 +0000
Revision:
10:989e5dbd12ee
Parent:
8:e16bb923afd3
Documented and final revision

Who changed what in which revision?

UserRevisionLine numberNew contents of line
el15mh 0:d7701c5c20e6 1 #include "mbed.h"
el15mh 0:d7701c5c20e6 2 #include "N5110.h"
el15mh 0:d7701c5c20e6 3 #include "Gamepad.h"
el15mh 6:84572bbd9c5c 4 #include "FXOS8700CQ.h"
el15mh 6:84572bbd9c5c 5 #include "Animations.h"
el15mh 3:02653cb1c8f8 6 #include "Menu.h"
el15mh 0:d7701c5c20e6 7
el15mh 0:d7701c5c20e6 8 // CREATE OBJECTS //
el15mh 0:d7701c5c20e6 9 N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11);
el15mh 6:84572bbd9c5c 10 FXOS8700CQ device(I2C_SDA,I2C_SCL);
el15mh 6:84572bbd9c5c 11 Animations animate;
el15mh 0:d7701c5c20e6 12 Gamepad pad;
el15mh 3:02653cb1c8f8 13 Menu menu;
el15mh 5:55eee1d71c1d 14
el15mh 0:d7701c5c20e6 15 // FUNCTION PROTOTYPES //
el15mh 0:d7701c5c20e6 16 void init();
el15mh 0:d7701c5c20e6 17
el15mh 0:d7701c5c20e6 18 int main()
el15mh 0:d7701c5c20e6 19 {
el15mh 0:d7701c5c20e6 20 init(); // initialise devices
el15mh 8:e16bb923afd3 21 // printf("Devices initialised \n");
el15mh 0:d7701c5c20e6 22
el15mh 8:e16bb923afd3 23 menu.intro(lcd, pad, animate);
el15mh 2:a488caea1601 24
el15mh 2:a488caea1601 25 while(1) {
el15mh 0:d7701c5c20e6 26
el15mh 6:84572bbd9c5c 27 menu.main(lcd, pad, device, animate);
el15mh 8:e16bb923afd3 28
el15mh 0:d7701c5c20e6 29 }
el15mh 0:d7701c5c20e6 30 }
el15mh 0:d7701c5c20e6 31
el15mh 2:a488caea1601 32
el15mh 1:8ce2586b5965 33 void init()
el15mh 0:d7701c5c20e6 34 {
el15mh 6:84572bbd9c5c 35 menu.init();
el15mh 1:8ce2586b5965 36 lcd.init();
el15mh 1:8ce2586b5965 37 pad.init();
el15mh 6:84572bbd9c5c 38 device.init();
el15mh 5:55eee1d71c1d 39 lcd.setBrightness(pad.read_pot());
el15mh 6:84572bbd9c5c 40 }