PRIMERA LIBRERÍA

Dependents:   PRIMERA_LIBRERIA1 PRIMERA_LIBRERIA1

Files at this revision

API Documentation at this revision

Comitter:
nicko12
Date:
Thu Jun 11 02:00:57 2020 +0000
Commit message:
EMINENCIA

Changed in this revision

MPP.cpp Show annotated file Show diff for this revision Revisions of this file
MPP.h Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 354bfba70118 MPP.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MPP.cpp	Thu Jun 11 02:00:57 2020 +0000
@@ -0,0 +1,159 @@
+#include "MPP.h"            //Conocete a ti misma, oh estirpe divina vestida de hombre
+#include "mbed.h"
+int finch=0;
+int grief=4;
+int num_pasos=0;
+int posi=5;
+int ever =0;
+int MPP::violet[4]={0b0001,
+                    0b0010,
+                    0b0100,
+                    0b1000,
+                    };
+MPP::MPP(PinName B1,PinName B2,PinName B3,PinName B4): paso(B1,B2,B3,B4) { }
+
+int MPP::Activate(bool dir)
+{
+    if (dir==1)
+    {
+     for(int i=0;i<512;i++)
+     {
+        paso=violet[posi];
+        wait(0.02);
+        posi--;
+        if(posi==0)
+        {
+            posi=5;
+        }
+     }
+    }
+    else if(dir==0)
+    {
+        for(int i=0;i<512;i++)
+     {
+        paso=violet[ever];
+        wait(0.02);
+        ever++;
+        if(ever==5)
+        {
+            ever=0;
+        }
+     }
+    }
+}
+
+int MPP::Evergarden(int garden)
+{
+    while(num_pasos<=(garden))
+    {
+        paso=violet[finch];
+        wait(0.02);
+        finch++;
+        //num_pasos++;
+        if(finch==5)
+        {
+            finch=0;
+            num_pasos++;
+        }
+        /*for (int i=0;i<(64*garden);i++)
+        {
+            paso=violet[finch];
+            wait(0.02);
+            finch++;
+            num_pasos++;
+            if (finch==5)
+            {
+                finch=0;
+            }
+            if(num_pasos==(garden*64))
+            {
+                paso=paso[finch];
+            }
+        }*/
+   }
+}
+int  MPP::Suicide_solution(int Ozzy)
+{
+    while(num_pasos<=(Ozzy*1.422222222))
+    {
+        paso=violet[finch];
+        wait(0.02);
+        finch++;
+        //num_pasos++;
+        if(finch==5)
+        {
+            finch=0;
+            num_pasos++;
+        }
+   }
+}
+int MPP::Fine_Again(int Seether,int Forsaken,int Marilyn)
+{
+switch (Marilyn)
+{
+case 1:
+    if (Forsaken==1)
+    {
+        while(num_pasos<=(Seether))
+     {
+        paso=violet[finch];
+        wait(0.02);
+        finch++;
+        //num_pasos++;
+        if(finch==5)
+        {
+            finch=0;
+            num_pasos++;
+        }
+     }
+    }
+    else if(Forsaken==2)
+    {
+        while(num_pasos<=(Seether*1.422222222))
+      {
+        paso=violet[finch];
+        wait(0.02);
+        finch++;
+        //num_pasos++;
+        if(finch==5)
+        {
+            finch=0;
+            num_pasos++;
+        }
+      }
+    }
+break;
+
+case 2:
+  if (Forsaken==1)
+    {
+        while(num_pasos<=(Seether))
+      {
+        paso=violet[grief];
+        wait(0.02);
+        grief--;
+        if(grief==0)
+        {
+            grief=4;
+            num_pasos++;
+        }
+      }
+    }
+    else if(Forsaken==2)
+    {
+        while(num_pasos<=(Seether*1.422222222))
+      {
+        paso=violet[grief];
+        wait(0.02);
+        grief--;
+        //num_pasos++;
+        if(grief==0)
+        {
+            grief=5;
+            num_pasos++;
+        }
+      }
+    }
+break;
+}
+}
\ No newline at end of file
diff -r 000000000000 -r 354bfba70118 MPP.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MPP.h	Thu Jun 11 02:00:57 2020 +0000
@@ -0,0 +1,25 @@
+#ifndef MPP_H
+#define MPP_H
+
+#include"mbed.h"
+
+class MPP
+{
+    public:
+    MPP(PinName B1,PinName B2,PinName B3,PinName B4);
+    int Activate(bool dir);
+    int Evergarden(int garden);
+    int Suicide_solution(int Ozzy);
+    int Fine_Again (int Seether,int Forsaken,int Marilyn);
+    private:
+    //int posi;
+    BusOut paso;
+    //BusOut paso(_B1,_B2,_B3,_B4);
+    static int violet[4];
+};
+/*int MPP::violet[4]={0b0001,
+                    0b0010,
+                    0b0100,
+                    0b1000,
+                    };*/
+#endif
\ No newline at end of file