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.
Diff: DRIBBLE.cpp
- Revision:
- 31:61f9fca504dd
- Child:
- 32:0fc1a21949f7
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DRIBBLE.cpp Fri May 13 06:26:53 2022 +0000
@@ -0,0 +1,34 @@
+/**
+ * @file MX12.ccp
+ * @brief This file contains all the methods of the MX12 class
+ * whose prototypes are in the MX12.h header file
+ */
+
+#include "DRIBBLE.h"
+#include "math.h"
+
+dribbleur::dribbleur(PinName tx)
+ : _moteurDribble(tx) // initializes UnbufferedSerial object
+{
+ _moteurDribble.pulsewidth_us(0);
+ _moteurDribble.period_us(100);
+};
+
+void dribbleur::SetSpeed(int pourcentage)
+{
+ _moteurDribble.pulsewidth_us(pourcentage);
+};
+
+void dribbleur::test()
+{
+ SetSpeed(10);
+};
+
+void dribbleur::SetSpeedSmooth()
+{
+ int i;
+ for (i=0;i<=30;i=i+1){
+ SetSpeed(i);
+ thread_sleep_for(100);
+ };
+};
\ No newline at end of file