Robert Schulte / Mbed 2 deprecated frdm_Motortryout2

Dependencies:   Encoder MODSERIAL mbed

Files at this revision

API Documentation at this revision

Comitter:
Rvs94
Date:
Mon Sep 21 10:11:51 2015 +0000
Child:
1:4e65a72b622e
Commit message:
Motor werkt op dit script, alleen nog niet naar behoren. LED feedback toegevoegd.

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	Mon Sep 21 10:11:51 2015 +0000
@@ -0,0 +1,1 @@
+https://mbed.org/users/vsluiter/code/Encoder/#18b000b443af
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MODSERIAL.lib	Mon Sep 21 10:11:51 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/Sissors/code/MODSERIAL/#8ef4f91813fd
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Sep 21 10:11:51 2015 +0000
@@ -0,0 +1,28 @@
+#include "mbed.h"
+#include "encoder.h"
+#include "MODSERIAL.h"
+ 
+Serial pc(USBTX, USBRX); // tx, rx
+DigitalOut led(LED_RED);
+DigitalOut motor2direction(D4); //D4 en D5 zijn motor 2 (op het motorshield)
+PwmOut motor2speed(D5);
+DigitalIn button1(SW3);
+
+int main()
+{
+    motor2direction = 0;
+    motor2speed = 0;
+    pc.baud(9600);
+    while(true)
+    {
+            if(button1 == 1)
+                {
+                    motor2direction = 1;
+                    motor2speed = 0.5f;
+                    pc.printf("het werkt");
+                    wait(1)
+                    led = 0;
+                    wait(0.2f)
+                }
+    }   
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Sep 21 10:11:51 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/4f6c30876dfa
\ No newline at end of file