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: Nucleo_blink_led mbed
Fork of Nucleo_blink_led by
Diff: funcdef.h
- Revision:
- 4:f1670eec4681
- Parent:
- 3:7f44ab64e96b
- Child:
- 5:dfea493f7a12
diff -r 7f44ab64e96b -r f1670eec4681 funcdef.h
--- 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
