Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: 4DGL-uLCD-SE Motor SparkfunAnalogJoystick mbed
Fork of Fire_Mbed_2_0 by
Diff: main.cpp
- Revision:
- 4:47c4ac917fd1
- Parent:
- 3:275705c872e0
- Child:
- 5:c920ad0bc875
diff -r 275705c872e0 -r 47c4ac917fd1 main.cpp
--- a/main.cpp Tue May 02 20:55:30 2017 +0000
+++ b/main.cpp Tue May 02 21:38:35 2017 +0000
@@ -7,7 +7,7 @@
#include "Motor.h"
int units_recieved = 0;
-Ticker flipper;
+
Motor m(p21, p24, p25); // pwm, fwd, rev
#define FORTRESS 0
@@ -183,7 +183,6 @@
cursor_y = 0;
state = 0;
person_t* temp_persona;
- flipper.attach(&waitForAck, 1);
while(1) {
if (state == 0){
selection = user_selecting();}
@@ -374,7 +373,7 @@
uLCD.printf("New Game\r\n");
uLCD.printf("Or Continue\r\n");
while(units_recieved == 0){
- wait(.5);}
+ waitForAck();}
load_units_map();
return;
}
@@ -1163,13 +1162,12 @@
{
led4=!led4;
command[0] = pc.getc();
- command[1] = pc.getc();
- if(strcmp(command, "rm")==0)
+ if(command[0] == 'm')
{
+ led1 = !led1;
sendMap();
- led1 = !led1;
}
- if(strcmp(command, "ru")==0)
+ if(command[0] == 'u')
{
sendUnits();
led1 = !led1;
@@ -1177,12 +1175,12 @@
uLCD.printf("enter combat phase");
combatPhase();
}
- if(strcmp(command, "sm")==0)
+ if(command[0] == 's')
{
receiveMap();
led2 = !led2;
}
- if(strcmp(command, "su")==0)
+ if(command[0] == 'z')
{
receiveUnits();
led2 = !led2;
