IMU is outputting garbage value to the terminal
Dependencies: mbed wave_player mbed-rtos 4DGL-uLCD-SE SDFileSystem
player.h@2:ade842cb48e9, 2021-04-23 (annotated)
- Committer:
- Tito96
- Date:
- Fri Apr 23 01:03:49 2021 +0000
- Revision:
- 2:ade842cb48e9
- Parent:
- 0:3817adfaeb06
one player with IMU
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
michaeljson | 0:3817adfaeb06 | 1 | #ifndef PLAYER_H |
michaeljson | 0:3817adfaeb06 | 2 | #define PLAYER_H |
michaeljson | 0:3817adfaeb06 | 3 | |
michaeljson | 0:3817adfaeb06 | 4 | #include "mbed.h" |
michaeljson | 0:3817adfaeb06 | 5 | #include "player.h" |
michaeljson | 0:3817adfaeb06 | 6 | #include "missile.h" |
michaeljson | 0:3817adfaeb06 | 7 | #include "globals.h" |
michaeljson | 0:3817adfaeb06 | 8 | |
michaeljson | 0:3817adfaeb06 | 9 | extern uLCD_4DGL uLCD; |
michaeljson | 0:3817adfaeb06 | 10 | |
michaeljson | 0:3817adfaeb06 | 11 | typedef enum { |
michaeljson | 0:3817adfaeb06 | 12 | PLAYER_DEAD = 0, |
michaeljson | 0:3817adfaeb06 | 13 | PLAYER_ALIVE = 1 |
michaeljson | 0:3817adfaeb06 | 14 | } PLAYER_STATUS; |
michaeljson | 0:3817adfaeb06 | 15 | |
michaeljson | 0:3817adfaeb06 | 16 | /// This struct contains the status of a player |
michaeljson | 0:3817adfaeb06 | 17 | typedef struct |
michaeljson | 0:3817adfaeb06 | 18 | { |
michaeljson | 0:3817adfaeb06 | 19 | int player_blk_x; ///< horizontal position in the grid |
michaeljson | 0:3817adfaeb06 | 20 | int player_blk_y; ///< vertical position in the grid |
michaeljson | 0:3817adfaeb06 | 21 | unsigned int player_old_blk_x; ///< old horizontal position in the grid |
michaeljson | 0:3817adfaeb06 | 22 | unsigned int player_old_blk_y; ///< old vertical position in the grid |
michaeljson | 0:3817adfaeb06 | 23 | int player_width; |
michaeljson | 0:3817adfaeb06 | 24 | int player_height; |
michaeljson | 0:3817adfaeb06 | 25 | int player_color; ///< color of the player |
michaeljson | 0:3817adfaeb06 | 26 | PLAYER_STATUS status; |
michaeljson | 0:3817adfaeb06 | 27 | } player_t; |
michaeljson | 0:3817adfaeb06 | 28 | |
michaeljson | 0:3817adfaeb06 | 29 | void player_init(player_t * g, int blk_x, int blk_y, int color); |
michaeljson | 0:3817adfaeb06 | 30 | void player_show(player_t *g); |
michaeljson | 0:3817adfaeb06 | 31 | void player_erase(player_t *g); |
michaeljson | 0:3817adfaeb06 | 32 | int check_player(player_t *g, missile_t *h); |
michaeljson | 0:3817adfaeb06 | 33 | #endif //PLAYER_H |