f
Dependencies: mbed 4DGL-uLCD-SE MMA8452
main.cpp
- Committer:
- lballard9
- Date:
- 2022-03-10
- Revision:
- 1:d57364f0349f
- Parent:
- 0:8e3b9bb1084a
- Child:
- 2:ca5910acbade
File content as of revision 1:d57364f0349f:
//================================================================= // 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" // ===User implementations start=== //For sound components ////AnalogOut DACout(p18); //PwmOut pwmout(p26); ////PwmOut speaker(p25); //speaker ////wave_player waver(&DACout); //SDFileSystem sd(p5, p6, p7, p8, "sd"); // mosi, miso, sck, cs // use the above for the wave player 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===