My ELEC2645 project. Nikollao Sulollari. 200804685

Dependencies:   N5110 SoftPWM mbed

Fork of Treasure_Hunt by ELEC2645 (2015/16)

Revision:
10:1d229362c134
Parent:
9:ce2d9c42edea
Child:
11:53caf3d944a9
--- a/main.h	Mon Apr 18 11:04:35 2016 +0000
+++ b/main.h	Wed Apr 27 17:09:13 2016 +0000
@@ -47,29 +47,36 @@
 InterruptIn sw2(SW2);
 InterruptIn sw3(SW3);
 
-/**
-@nameSpace button
-@brief interrupt executes an event triggered task
-*/
-InterruptIn button(PTB2);
 
 /**
 @nameSpace xPot
 @brief read x-axis position from the value of the joystick
 */
-AnalogIn xPot(PTB3);
+AnalogIn xPot(PTB2);
 
 /**
 @nameSpace yPot
 @brief read y-axis position from the value of the joystick
 */
-AnalogIn yPot(PTB10);
+AnalogIn yPot(PTB3);
+
+/**
+@nameSpace button
+@brief interrupt executes an event triggered task
+*/
+InterruptIn button(PTB10);
+
+/**
+@nameSpace button
+@brief interrupt executes an event triggered task
+*/
+InterruptIn button1(PTB18);
 
 /**
 @nameSpace buzzer
 @brief create PWM signal to set buzzer duty cycle and period
 */
-PwmOut buzzer(PTC11);
+PwmOut buzzer(PTB9);
 
 /**
 @nameSpace ticker
@@ -263,7 +270,9 @@
 
 volatile int g_sw3_flag = 0;  /*!< set timer flag in the isr, event trigger interrupt */
 
-volatile int g_button_flag = 0;  /*!< set timer flag in the isr, event trigger interrupt */
+volatile int g_button_flag = 0;  /*!< set flag in the isr, event trigger interrupt */
+
+volatile int g_button1_flag = 0; /*!< set flag in the isr, event trigger interrupt */
 
 volatile int option = 0;  /*!< select option in menu based on Joystick's movement */
 
@@ -283,6 +292,7 @@
 int state = 0; /*!< controls the direction of the objtacle */
 
 int objectX1 = 58; /*!< used to move obstacles in the x-axis */
+
 int state1 = 1; /*!< controls the direction of the objtacle */