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.
Dependencies: HIDScope MODSERIAL QEI biquadFilter mbed
Fork of frdm_Motor_V2_3 by
Revision 1:48aba8d5610a, committed 2015-09-28
- Comitter:
- Rvs94
- Date:
- Mon Sep 28 10:49:56 2015 +0000
- Parent:
- 0:284ed397e046
- Child:
- 2:099da0fc31b6
- Commit message:
- Aantal Degs ook in HIDScope gekregen. fundering voor totaal script is gelegd
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Mon Sep 28 10:25:52 2015 +0000
+++ b/main.cpp Mon Sep 28 10:49:56 2015 +0000
@@ -10,21 +10,26 @@
DigitalIn button1(SW3);
DigitalIn EncoderA(D3);
DigitalIn EncoderB(D2);
-HIDScope scope(2);
+QEI Encoder(D3, D2, NC, 32);
+HIDScope scope(3);
Ticker ScopeTime;
+float Aantal_Degs;
+float Aantal_pulses;
void ScopeSend()//Functie die de gegevens voor de scope uitleest en doorstuurt
{
scope.set(0, motor2direction.read());
scope.set(1, motor2speed.read());
+ scope.set(2, Aantal_Degs);
+ Aantal_Degs = Encoder.getPulses()*360/31/131;
scope.send();
+
}
int main()
{
motor2direction = 0;
motor2speed = 0;
- wait(2);
led = 1;
pc.baud(115200);
pc.printf("Tot aan loop werkt");
@@ -33,14 +38,14 @@
while (true)
{
+
motor2direction = 1;
motor2speed = 0.5f;
- pc.printf("1\n");
- wait(0.1);
- pc.printf("2222222222\n");
+ wait(1);
+
motor2direction = 0;
- motor2speed = 0.3f;
- pc.printf("333\n");
+ motor2speed = 0.5f;
+ wait(1);
}
}
\ No newline at end of file
