Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
MAIN.cpp
00001 /* mbed Microcontroller Library 00002 * Copyright (c) 2019 ARM Limited 00003 * SPDX-License-Identifier: Apache-2.0 00004 */ 00005 00006 #include "mbed.h" 00007 00008 #include "N5110.h" 00009 #include "Gamepad.h" 00010 #include "SnakeEngine.h" 00011 00012 00013 Gamepad gamePad; 00014 N5110 lcd; 00015 SnakeEngine snakeEngine(gamePad,lcd); 00016 00017 int gameSpeed; 00018 00019 00020 00021 00022 int main(){ 00023 int fps = 6; 00024 gamePad.init(); 00025 gamePad.reset_buttons(); 00026 00027 lcd.init(); 00028 snakeEngine.init(); 00029 snakeEngine.welcome(); 00030 gameSpeed = snakeEngine.getGameSpeed(); // initiallize the game speed to lowest 00031 00032 fps = gameSpeed*2; 00033 while(true){ 00034 snakeEngine.runGameEngine(); 00035 gameSpeed = snakeEngine.getGameSpeed(); 00036 fps = gameSpeed*2; 00037 wait(1.0f/fps); // we wait accordingly to game speed 00038 } 00039 00040 }
Generated on Wed Jul 13 2022 01:33:24 by
1.7.2