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@0:899c85cd266f, 2015-10-06 (annotated)
- Committer:
- jford38
- Date:
- Tue Oct 06 01:54:18 2015 +0000
- Revision:
- 0:899c85cd266f
- Child:
- 1:0589ea36661b
Working Player1 Demo. Uses print statements in lieu of the LCD (Don't have two LCD's yet.); Doesn't have two-way communication yet. Currently, P2 can only receive from P1 but can't send anything back.
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 | 0:899c85cd266f | 12 | |
jford38 | 0:899c85cd266f | 13 | pc.printf("I'm alive! Player 1\n"); |
jford38 | 0:899c85cd266f | 14 | |
jford38 | 0:899c85cd266f | 15 | uLCD.init(); |
jford38 | 0:899c85cd266f | 16 | pc.printf("Initialized...\n"); |
jford38 | 0:899c85cd266f | 17 | while(1) { |
jford38 | 0:899c85cd266f | 18 | uLCD.set_button_state(1,0,1,0,1); |
jford38 | 0:899c85cd266f | 19 | uLCD.background_color(BLUE); |
jford38 | 0:899c85cd266f | 20 | uLCD.cls(); |
jford38 | 0:899c85cd266f | 21 | uLCD.update(); |
jford38 | 0:899c85cd266f | 22 | pc.printf("Updated. \n"); |
jford38 | 0:899c85cd266f | 23 | wait(1); |
jford38 | 0:899c85cd266f | 24 | pc.printf("\033[2J\033[0;0H"); |
jford38 | 0:899c85cd266f | 25 | } |
jford38 | 0:899c85cd266f | 26 | // |
jford38 | 0:899c85cd266f | 27 | //uLCD.line(0,0,200,200,BLACK); |
jford38 | 0:899c85cd266f | 28 | } |