My ELEC2645 Project Zhou Jingyuan 200986046

Dependencies:   ZhouJingyuan mbed

Committer:
Iverson66
Date:
Thu May 05 12:39:59 2016 +0000
Revision:
0:c5868f162227
Zhou JIngyuan 200986046

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Iverson66 0:c5868f162227 1 #ifndef MAIN_H
Iverson66 0:c5868f162227 2 #define MAIN_H
Iverson66 0:c5868f162227 3 #include "mbed.h"
Iverson66 0:c5868f162227 4 #include "N5110.h"
Iverson66 0:c5868f162227 5 #include <stdlib.h> //headfile for the random value
Iverson66 0:c5868f162227 6 #include <time.h>
Iverson66 0:c5868f162227 7 #define DIRECTION_TOLERANCE 0.05 // change this to alter tolerance of joystick direction
Iverson66 0:c5868f162227 8
Iverson66 0:c5868f162227 9
Iverson66 0:c5868f162227 10 // function prototypes
Iverson66 0:c5868f162227 11 void calibrateJoystick(); // the function about read default positions of the joystick to calibrate later readings
Iverson66 0:c5868f162227 12 void updateJoystick(); //the function to recognize the direction of the joystick
Iverson66 0:c5868f162227 13 void illustration(); //the explication of the game
Iverson66 0:c5868f162227 14 void moving (); //moving for the practice
Iverson66 0:c5868f162227 15 void moving2 (); //moving for the second challenge
Iverson66 0:c5868f162227 16 int setpointx (int); //get x value of the ball
Iverson66 0:c5868f162227 17 int setpointy (int); //get y value of the ball
Iverson66 0:c5868f162227 18 //global constant in the function
Iverson66 0:c5868f162227 19 int printFlag = 0; //to refresh the ticker function
Iverson66 0:c5868f162227 20 int x = 55; // initial x value of people
Iverson66 0:c5868f162227 21 int y = 23; // initial y value of people
Iverson66 0:c5868f162227 22 int q=50; //the initial constant for the second part game
Iverson66 0:c5868f162227 23 int r=0; //to break the while(1) loop
Iverson66 0:c5868f162227 24
Iverson66 0:c5868f162227 25 #endif