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: mbed
Diff: main.cpp
- Revision:
- 5:aab0171a8065
- Parent:
- 4:4843445e717a
- Child:
- 6:434bb72ffc26
--- a/main.cpp Mon Jun 06 05:44:23 2016 +0000
+++ b/main.cpp Thu Jun 16 19:29:17 2016 +0000
@@ -6,7 +6,14 @@
//////////////////////////////Init
Serial pc(SERIAL_TX, SERIAL_RX);
-
+DigitalIn Switch_0(D4);
+DigitalIn Switch_1(D1);
+DigitalOut LED_Red(D5);
+DigitalOut LED_2(A4);
+DigitalOut LED_3(A5);
+AnalogIn BatteryVot(A0);
+//DigitalIn Switch_2(D2);
+//DigitalIn Switch_3(D3);
//////////////////////////////////////////////////////////////////////
@@ -17,7 +24,7 @@
double NowFaceAngle, NowDirectionInRad;
long SelfRotation;
double TargetCoordinate[2];
-double Goal_1_Coordinate[2], Goal_2_Coordinate[2], Ball_Coordinate[2], Last_Ball_Coordinate[2];//, Ball_2_Coordinate[2];
+double Goal_1_Coordinate[2], Goal_2_Coordinate[2], Ball_Coordinate[2], Last_Ball_Coordinate[2], Enemy_Ball_Coordinate[2];//, Ball_2_Coordinate[2];
bool TargetCoordinateValid;
double Car1XforStra1, Car1YforStra1, Car1DirectionforStra1, BlueBallXforStra1, BlueBallYforStra1, GreenBallXforStra1, GreenBallYforStra1;
double Car2XforStra1, Car2YforStra1, Car2DirectionforStra1;
@@ -40,7 +47,12 @@
void InitIO(void)
{
-
+ Switch_0.mode(PullUp);
+ Switch_1.mode(PullUp);
+ //Switch_2.mode(PullUp);
+ //Switch_3.mode(PullUp);
+ LED_2 = 0;
+ LED_3 = 0;
}
int main()