el15mh 200929957

Dependencies:   mbed

Committer:
el15mh
Date:
Wed May 03 21:14:23 2017 +0000
Revision:
6:84572bbd9c5c
Parent:
5:55eee1d71c1d
Child:
8:e16bb923afd3
fully working program

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 5:55eee1d71c1d 21 printf("Devices initialised \n");
el15mh 0:d7701c5c20e6 22
el15mh 6:84572bbd9c5c 23 // menu.intro(lcd, pad, animate);
el15mh 2:a488caea1601 24
el15mh 2:a488caea1601 25 while(1) {
el15mh 0:d7701c5c20e6 26
el15mh 6:84572bbd9c5c 27 // printf("Start menu \n");
el15mh 6:84572bbd9c5c 28 menu.main(lcd, pad, device, animate);
el15mh 6:84572bbd9c5c 29 //lcd.clear();
el15mh 6:84572bbd9c5c 30 //menu.animateJoystick(lcd);
el15mh 6:84572bbd9c5c 31 // menu.animateGamepad(lcd, pad);
el15mh 6:84572bbd9c5c 32 //lcd.refresh();
el15mh 0:d7701c5c20e6 33 }
el15mh 0:d7701c5c20e6 34 }
el15mh 0:d7701c5c20e6 35
el15mh 2:a488caea1601 36
el15mh 1:8ce2586b5965 37 void init()
el15mh 0:d7701c5c20e6 38 {
el15mh 6:84572bbd9c5c 39 menu.init();
el15mh 1:8ce2586b5965 40 lcd.init();
el15mh 1:8ce2586b5965 41 pad.init();
el15mh 6:84572bbd9c5c 42 device.init();
el15mh 5:55eee1d71c1d 43 lcd.setBrightness(pad.read_pot());
el15mh 6:84572bbd9c5c 44 }