The classic dueling tanks game for mbed.
Dependencies: 4DGL-uLCD-SE DRV2605 EthernetInterface Game_Synchronizer MMA8452 SDFileSystem SparkfunAnalogJoystick mbed-rtos mbed wave_player
Fork of 2035_Tanks_Shell by
main.cpp@2:c358ad9aedc4, 2015-10-12 (annotated)
- Committer:
- jford38
- Date:
- Mon Oct 12 04:23:24 2015 +0000
- Revision:
- 2:c358ad9aedc4
- Parent:
- 1:0589ea36661b
- Child:
- 3:3ddefff03cb2
Last commit with UDP. Switching to TCP.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jford38 | 0:899c85cd266f | 1 | // THIS GUY LISTENS AND REPEATS. CLIENT. MASTER. |
jford38 | 0:899c85cd266f | 2 | // (It doesn't make sense, I know.) |
jford38 | 0:899c85cd266f | 3 | |
jford38 | 0:899c85cd266f | 4 | #include "mbed.h" |
jford38 | 0:899c85cd266f | 5 | #include "two_player.h" |
jford38 | 0:899c85cd266f | 6 | |
jford38 | 0:899c85cd266f | 7 | |
jford38 | 0:899c85cd266f | 8 | uLCD_2P uLCD(p28,p27,p26, PLAYER1); // serial tx, serial rx, reset pin; |
jford38 | 0:899c85cd266f | 9 | |
jford38 | 0:899c85cd266f | 10 | |
jford38 | 0:899c85cd266f | 11 | int main (void) { |
jford38 | 1:0589ea36661b | 12 | int* buttons; |
jford38 | 1:0589ea36661b | 13 | |
jford38 | 1:0589ea36661b | 14 | pc.printf("\033[2J\033[0;0H"); |
jford38 | 0:899c85cd266f | 15 | pc.printf("I'm alive! Player 1\n"); |
jford38 | 0:899c85cd266f | 16 | |
jford38 | 0:899c85cd266f | 17 | uLCD.init(); |
jford38 | 0:899c85cd266f | 18 | pc.printf("Initialized...\n"); |
jford38 | 0:899c85cd266f | 19 | while(1) { |
jford38 | 0:899c85cd266f | 20 | uLCD.background_color(BLUE); |
jford38 | 0:899c85cd266f | 21 | uLCD.cls(); |
jford38 | 0:899c85cd266f | 22 | uLCD.update(); |
jford38 | 0:899c85cd266f | 23 | pc.printf("Updated. \n"); |
jford38 | 1:0589ea36661b | 24 | buttons = uLCD.get_button_state(); |
jford38 | 1:0589ea36661b | 25 | pc.printf("Button State: %x %x %x %x %x\n", buttons[0], buttons[1], buttons[2], buttons[3], buttons[4]); |
jford38 | 2:c358ad9aedc4 | 26 | wait(0.5); |
jford38 | 1:0589ea36661b | 27 | //pc.printf("\033[2J\033[0;0H"); |
jford38 | 0:899c85cd266f | 28 | } |
jford38 | 0:899c85cd266f | 29 | // |
jford38 | 0:899c85cd266f | 30 | //uLCD.line(0,0,200,200,BLACK); |
jford38 | 0:899c85cd266f | 31 | } |