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: eeprom_intern LCD_i2c_GSOE MotorinoLib
Diff: main.cpp
- Revision:
- 0:4db26ffb591c
- Child:
- 2:e9fbdcb1ee8f
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Tue Sep 28 15:50:53 2021 +0000
@@ -0,0 +1,90 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2019 ARM Limited
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+#include "mbed.h"
+#include "platform/mbed_thread.h"
+#include "Kanal.h"
+
+
+
+// Blinking rate in milliseconds
+#define BLINKING_RATE_MS 50
+
+Kanal Greifer(0);
+Kanal Basis(1);
+Kanal Oberarm(2);
+
+
+struct position
+{
+ float w[6];
+ int ms;
+};
+
+position schritt[3];
+
+
+int main()
+{
+
+ Kanal* achse[6];
+ for (int i=0;i<6;i++) achse[i]=new Kanal(i);
+ int dtc=0;
+ // Initialise the digital pin LED1 as an output
+ DigitalOut led(LED1);
+ schritt[0].w[0]=0;
+ schritt[0].w[1]=0;
+ schritt[0].w[2]=0;
+ schritt[0].w[3]=0;
+ schritt[0].w[4]=0;
+ schritt[0].w[5]=0;
+ schritt[0].ms=1000;
+
+ schritt[1].w[0]=180;
+ schritt[1].w[1]=90;
+ schritt[1].w[2]=180;
+ schritt[1].w[3]=90;
+ schritt[1].w[4]=180;
+ schritt[1].w[5]=90;
+ schritt[1].ms=500;
+
+ schritt[2].w[0]=90;
+ schritt[2].w[1]=180;
+ schritt[2].w[2]=90;
+ schritt[2].w[3]=180;
+ schritt[2].w[4]=90;
+ schritt[2].w[5]=180;
+ schritt[2].ms=500;
+ while (true) {
+ led = !led;
+ for (int j=0;j<3;j++)
+ {
+ for (int i=0;i<6;i++)
+ {
+ achse[i]->go(schritt[j].w[i],schritt[j].ms);
+ }
+ for (int i=0;i<6;i++)
+ {
+ while(achse[i]->isBusy());
+ }
+ }
+ /*
+ Greifer.go(180,1000);
+ Basis.go(90,1000);
+ Oberarm.go(0,1000);
+ while (Greifer.isBusy()==true);
+ while (Basis.isBusy()==true);
+ while (Oberarm.isBusy()==true);
+ //HAL_Delay(2000);
+ Greifer.go(0,500);
+ Basis.go(0,500);
+ Oberarm.go(120,500);
+ //HAL_Delay(1000);
+ while (Greifer.isBusy()==true);
+ while (Basis.isBusy()==true);
+ while (Oberarm.isBusy()==true);
+ */
+ }
+}