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:
- 2:439a3a118526
- Parent:
- 0:839ba4bb1be1
--- a/main.cpp Mon Sep 20 14:48:02 2010 +0000
+++ b/main.cpp Tue Sep 21 16:00:43 2010 +0000
@@ -1,3 +1,8 @@
+/**
+* Copyright (c)2010 ARM Ltd.
+* Released under the MIT License: http://mbed.org/license/mit
+*/
+
#include "mbed.h"
#include "QEI.h"
#include "Motor.h"
@@ -23,14 +28,10 @@
float NoPulses;
while(1){
- //This code writes the value of MotorOutput to the Motor and reads the number of pulses into the percentage.
-
- NoPulses = Encoder.getPulses();
+ NoPulses = Encoder.getPulses();
Percentage = ((NoPulses / 48) * 100);
-
- //RPC will be used to set the value of MotorOut.
+ //RPC will be used to set the value of MotorOutput.
Wheel.speed((MotorOutput - 50) * 2 / 100);
-
wait(0.005);
}
}
\ No newline at end of file