![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
f
Dependencies: mbed 4DGL-uLCD-SE MMA8452
main.cpp
- Committer:
- lballard9
- Date:
- 2022-03-10
- Revision:
- 2:ca5910acbade
- Parent:
- 1:d57364f0349f
- Child:
- 3:ebf55ea6f18b
File content as of revision 2:ca5910acbade:
//================================================================= // The main program file. // // Copyright 2022 Georgia Tech. All rights reserved. // The materials provided by the instructor in this course are for // the use of the students currently enrolled in the course. // Copyrighted course materials may not be further disseminated. // This file must not be made publicly available anywhere. //================================================================== // External libs #include <stdlib.h> // Project includes #include "globals.h" #include "hardware.h" #include "graphics.h" #include "keyboard.h" //some LED's to use for debugging. DigitalOut myled1(LED1); DigitalOut myled2(LED2); DigitalOut myled3(LED3); DigitalOut myled4(LED4); void set_random_seed(Timer); /* * This function handles the main logic of the game. You should * initialize the hardware in this function, make calls to * functions that update the keyboard and your guess of * the word. */ int main() { GameInputs inputs; // First things first: initialize hardware ASSERT_P(hardware_init() == ERROR_NONE, "Hardware init failed!"); pc.printf("Program Starting\n"); //led1 hardware initialization myled1=1; Timer t; int dt; // delta time /* Put your code for main menu here, seed random function here as well */ // initialize the game state, print something to the screen and wait for an input. // do that before entering this game loop while(1){ t.start(); //start a timer draw_lower_status(); //draw the lower status bar inputs = read_inputs(); //read the inputs of the game /* your code here, make decisions based on those inputs, update the keyboard make selections, update words etc. */ t.stop(); dt = t.read_ms(); } } /* * This function sets the random seed for the game. * It also initializes the keyboard. You may choose to * put the start screen in here as well. This should be * called in the main function above. */ void set_random_seed(Timer t) { } // ===User implementations end===