
test
Dependents: MouseHybridSenseCode
Diff: funcdef.h
- Revision:
- 4:f1670eec4681
- Parent:
- 3:7f44ab64e96b
- Child:
- 5:dfea493f7a12
--- a/funcdef.h Mon Mar 05 22:40:25 2018 +0000 +++ b/funcdef.h Wed Mar 07 19:27:13 2018 +0000 @@ -1,12 +1,15 @@ -//these are used to define the file once +//Define the file once #ifndef FUNCDEF_H #define FUNCDEF_H -#include "mbed.h" -//Set up PC link (comment out when not using) +//Import Modules +#include "mbed.h" +#include "FastPWM.h" + +//Set up PC link (comment out when not using), set up 9600 if using plotter static Serial pc = Serial(USBTX, USBRX); -//Pin Definitions +//Pin Names #define sensor1pin A0 #define sensor2pin A1 #define sensor3pin A2 @@ -18,11 +21,18 @@ #define leftMotorpin D5 #define rightMotorpin D6 +#define buzzerPin D10 +//Pin Definitions static DigitalOut LEDVal = DigitalOut(LED1); -static PwmOut leftMotorVal = PwmOut(leftMotorpin); -static PwmOut rightMotorVal = PwmOut(rightMotorpin); +//static PwmOut leftMotorVal = PwmOut(leftMotorpin); +//static PwmOut rightMotorVal = PwmOut(rightMotorpin); +static FastPWM leftMotorVal(leftMotorpin,1); +static FastPWM rightMotorVal(rightMotorpin,1); +static PwmOut buzzerVal = PwmOut(buzzerPin); + +//Variable Definitions static int sensorValue[] = {0,0,0,0,0,0,0,0}; static int sensorMinValue[] = {0,0,0,0,0,0,0,0}; @@ -41,5 +51,6 @@ //Function Definitions void CalibrateFunc(void); void func(void); +void beep(int); #endif // FUNCDEF_H \ No newline at end of file