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: main.cpp
- Revision:
- 0:27d918875644
diff -r 000000000000 -r 27d918875644 main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Wed Sep 23 09:20:39 2015 +0000
@@ -0,0 +1,50 @@
+#include "mbed.h"
+#include "HIDScope.h"
+
+
+// Define pin for motor control
+DigitalOut dirPin(D4);
+DigitalOut PWM(D5);
+
+// Define the HIDScope and Ticker object
+HIDScope scope(1); //
+Ticker scopeTimer;
+
+// Read the analog input
+AnalogIn a0(PTC10);
+
+
+
+
+// The data read and send function
+void scopeSend()
+{
+ scope.set(0,a0.read());
+ scope.send();
+}
+
+
+int main()
+{
+ // Attach the data read and send function at 100 Hz
+ scopeTimer.attach_us(&scopeSend, 1e4);
+
+ while(1) { // let the motor run
+ dirPin.write(0);
+ PWM.write(1);
+
+ }
+
+
+
+
+
+}
+
+
+
+
+
+
+
+