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.
Revision 5:a2cd5cb8a600, committed 2017-05-10
- Comitter:
- schuema4
- Date:
- Wed May 10 12:57:28 2017 +0000
- Parent:
- 4:52685928a7c3
- Commit message:
- Version 10.05.16/14:57
Changed in this revision
| liftAnsteuerung.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/liftAnsteuerung.cpp Wed May 10 11:37:42 2017 +0000
+++ b/liftAnsteuerung.cpp Wed May 10 12:57:28 2017 +0000
@@ -19,12 +19,29 @@
{
}
void liftansteuerung(int zeitintervall, int ruecklaufzeit, Servo* servoAusw){
- for (int i=0;i < zeitintervall;i++){
+
+ int M1;
+ int M2;
+
+ if (M1<zeitintervall){
servoAusw->write(1.1f);
+ M1++;
+
+ }
+ if (M1==zeitintervall){
+ M2=1;
}
- for (int k=0; k < ruecklaufzeit;k++){
+
+ if (M2<ruecklaufzeit){
servoAusw->write(0.1f);
+ M2++;
}
+
+ if (M2==ruecklaufzeit){
+ M1=0;
+ M2=0;
+ }
+
}
void LiftAnsteuerung::setSerialOutput(Serial *pc)
{