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
- Committer:
- jford38
- Date:
- 2015-10-15
- Revision:
- 5:cfec780c935b
- Parent:
- 4:d8bd8b41468d
- Child:
- 6:3be57cf4bd33
File content as of revision 5:cfec780c935b:
// THIS GUY LISTENS AND REPEATS. CLIENT. MASTER.
// (It doesn't make sense, I know.)
#include "mbed.h"
#include "two_player.h"
uLCD_2P uLCD(p28,p27,p26, PLAYER1); // serial tx, serial rx, reset pin;
int main (void) {
int* buttons;
pc.printf("\033[2J\033[0;0H");
pc.printf("I'm alive! Player 1\n");
uLCD.init();
pc.printf("Initialized...\n");
float theta = 0;
while(1) {
uLCD.line(64,64,64+50*cos(theta),64+50*sin(theta), BLACK);
theta += 0.05;
uLCD.line(64,64,64+50*cos(theta),64+50*sin(theta), RED);
uLCD.circle(10,10,100, GREEN);
uLCD.filled_circle(4,4,10, 0xAB);
uLCD.triangle(10,10, 20,20, 20,40, 0xAB);
uLCD.rectangle(100,100, 90,90, GREEN);
uLCD.filled_rectangle(100,100, 110,110, 0xAB);
uLCD.pixel(40, 40, WHITE);
uLCD.update();
buttons = uLCD.get_button_state();
//pc.printf("Button State: %x %x %x %x %x\n", buttons[0], buttons[1], buttons[2], buttons[3], buttons[4]);
//pc.printf("\033[2J\033[0;0H");
}
}
