Peter Bartels / Mbed 2 deprecated Motor_component_testing_1

Dependencies:   Encoder HIDScope mbed

Fork of Motor_component_testing by Bart Arendshorst

Files at this revision

API Documentation at this revision

Comitter:
phgbartels
Date:
Thu Oct 23 09:09:24 2014 +0000
Child:
1:0471de635f87
Commit message:
Motor component testing

Changed in this revision

Encoder.lib Show annotated file Show diff for this revision Revisions of this file
HIDScope.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Encoder.lib	Thu Oct 23 09:09:24 2014 +0000
@@ -0,0 +1,1 @@
+https://mbed.org/users/vsluiter/code/Encoder/#18b000b443af
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/HIDScope.lib	Thu Oct 23 09:09:24 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/tomlankhorst/code/HIDScope/#e44574634162
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Oct 23 09:09:24 2014 +0000
@@ -0,0 +1,60 @@
+#include "mbed.h"
+#include "encoder.h"
+//#include "HIDScope.h"
+#include "PwmOut.h"
+#define M1_PWM PTA5
+#define M1_DIR PTA4
+
+Encoder motor1(PTD3,PTD1, true);
+PwmOut pwm_motor1(M1_PWM);
+DigitalOut motordir1(M1_DIR);
+DigitalOut LED(LED_GREEN);
+
+float PWM = 0.2; /// (1000/200); 
+//HIDScope scope(3);
+    
+int main() {
+    //pwm_motor1.period_us(100);
+    //pwm_motor1.write(PWM);  
+    LED = 0;
+    motordir1 = 1; 
+    while(true) {
+            //wait(3);
+            pwm_motor1.write(0.4);
+            LED = 1;
+            //wait(1);
+            //PWM = PWM + 0.05; 
+          
+            //pwm_motor1.pulsewidth_us(50);
+ 
+            //scope.set(0, motor1.getPosition());
+            //scope.set(1, DigitalIn(PTD3)); 
+            //scope.set(2, DigitalIn(PTD1)); 
+            //scope.send();
+            //wait(0.01);
+        
+        /*
+        while (PWM > 0) {
+            PWM = PWM - 0.005; 
+            motordir1 = 0; 
+            pwm_motor1.write(PWM); 
+            scope.set(0, motor1.getPosition());
+            scope.set(1, DigitalIn(PTD3)); 
+            scope.set(2, DigitalIn(PTD1)); 
+            scope.set(3, pwm_motor1);
+            scope.send();
+            wait(0.005);
+            }
+        while (PWM < 1) {
+            PWM = PWM + 0.005;
+        motordir1 = 0; 
+        pwm_motor1.write(PWM);
+        scope.set(0, motor1.getPosition());
+        scope.set(1, DigitalIn(PTD3)); 
+        scope.set(2, DigitalIn(PTD1)); 
+        scope.set(3, pwm_motor1);
+        scope.send();
+        wait(0.005);
+            }*/
+        }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Oct 23 09:09:24 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/552587b429a1
\ No newline at end of file