Programmaatje om de motoren aan te sturen met PuTTY.

Dependencies:   Encoder MODSERIAL mbed

Files at this revision

API Documentation at this revision

Comitter:
BasvanBuuren
Date:
Wed Oct 22 10:49:40 2014 +0000
Commit message:
Simpel programmaatje om de motoren aan te sturen met PuTTY.

Changed in this revision

Encoder.lib Show annotated file Show diff for this revision Revisions of this file
MODSERIAL.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	Wed Oct 22 10:49:40 2014 +0000
@@ -0,0 +1,1 @@
+https://mbed.org/users/vsluiter/code/Encoder/#2dd7853c911a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MODSERIAL.lib	Wed Oct 22 10:49:40 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/Sissors/code/MODSERIAL/#b04ce87dc424
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Oct 22 10:49:40 2014 +0000
@@ -0,0 +1,43 @@
+#include "mbed.h"
+#include "encoder.h"
+#include <iostream>
+
+int main()
+{
+    PwmOut m_speed1(PTA5);
+    DigitalOut m_dir1(PTA4);
+    PwmOut m_speed2(PTC8);
+    DigitalOut m_dir2(PTC9);    
+    
+    float s_speed1;
+    float s_dir1;
+    float s_speed2;
+    float s_dir2;
+    
+    
+    while(1)
+    {
+        cout << "Speed motor 1: " << endl;
+        cin >> s_speed1;
+        cout << s_speed1 << endl;
+        cout << "Direction motor 1: " << endl;
+        cin >> s_dir1;
+        cout << s_dir1 << endl;
+        cout << "Speed motor 2: " << endl;
+        cin >> s_speed2;
+        cout << s_speed2 << endl;
+        cout << "Direction motor 2: " << endl;
+        cin >> s_dir2;
+        cout << s_dir2 << endl;
+        m_speed1=0;
+        m_speed2=0;
+        cout << "Wait for it..." <<endl;
+        wait(3);
+        m_speed1=s_speed1;
+        m_dir1=s_dir1;
+        m_speed2=s_speed2;
+        m_dir2=s_dir2;
+        cout << "Go!" << endl;
+        wait(3);
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Oct 22 10:49:40 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/a9913a65894f
\ No newline at end of file