diff --git a/i2c-hub/circuit/.$I2CHubCircuit.drawio.bkp b/i2c-hub/circuit/.$I2CHubCircuit.drawio.bkp
new file mode 100644
index 0000000..745d223
--- /dev/null
+++ b/i2c-hub/circuit/.$I2CHubCircuit.drawio.bkp
@@ -0,0 +1,372 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/i2c-hub/circuit/I2CHubCircuit.drawio b/i2c-hub/circuit/I2CHubCircuit.drawio
new file mode 100644
index 0000000..745d223
--- /dev/null
+++ b/i2c-hub/circuit/I2CHubCircuit.drawio
@@ -0,0 +1,372 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/i2c-hub/firmware/i2c-hub-firmware/docs/.$NetworkStack.drawio.bkp b/i2c-hub/firmware/i2c-hub-firmware/docs/.$NetworkStack.drawio.bkp
index 4b68a4c..c86c49a 100644
--- a/i2c-hub/firmware/i2c-hub-firmware/docs/.$NetworkStack.drawio.bkp
+++ b/i2c-hub/firmware/i2c-hub-firmware/docs/.$NetworkStack.drawio.bkp
@@ -1,6 +1,6 @@
-
+
@@ -1446,6 +1446,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/i2c-hub/firmware/i2c-hub-firmware/docs/.$NetworkStack.drawio.dtmp b/i2c-hub/firmware/i2c-hub-firmware/docs/.$NetworkStack.drawio.dtmp
new file mode 100644
index 0000000..d3f0b54
--- /dev/null
+++ b/i2c-hub/firmware/i2c-hub-firmware/docs/.$NetworkStack.drawio.dtmp
@@ -0,0 +1,1479 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/i2c-hub/firmware/i2c-hub-firmware/docs/NetworkStack.drawio b/i2c-hub/firmware/i2c-hub-firmware/docs/NetworkStack.drawio
index c86c49a..afe80be 100644
--- a/i2c-hub/firmware/i2c-hub-firmware/docs/NetworkStack.drawio
+++ b/i2c-hub/firmware/i2c-hub-firmware/docs/NetworkStack.drawio
@@ -1,6 +1,6 @@
-
+
@@ -1235,6 +1235,9 @@
+
+
+
@@ -1467,6 +1470,9 @@
+
+
+
diff --git a/i2c-hub/firmware/i2c-hub-firmware/src/gobotrpc/include/pinConfig.hpp b/i2c-hub/firmware/i2c-hub-firmware/src/gobotrpc/include/pinConfig.hpp
index d1aa78c..fe2f1d0 100644
--- a/i2c-hub/firmware/i2c-hub-firmware/src/gobotrpc/include/pinConfig.hpp
+++ b/i2c-hub/firmware/i2c-hub-firmware/src/gobotrpc/include/pinConfig.hpp
@@ -1,5 +1,9 @@
#pragma once
+#define LED1_PIN 8
+#define LED2_PIN 9
+#define LED3_PIN 25
+
#define GOBOTRPC_CI_UART_RX 0
#define GOBOTRPC_CI_UART_TX 1
@@ -9,7 +13,7 @@
#define GOBOTRPC_TI_INT_PIN_START 10
#define GOBOTRPC_TI_INT_NUM 4
-#define GOBOTRPC_TI_COMBINED_INT_PIN 2
+#define GOBOTRPC_TI_COMBINED_INT_PIN 18
#define GOBOTRPC_TI_EXTERNAL_PULLUP 0
diff --git a/i2c-hub/firmware/i2c-hub-firmware/src/gobotrpc/transmission_interface/rp2040_i2c_tx.cpp b/i2c-hub/firmware/i2c-hub-firmware/src/gobotrpc/transmission_interface/rp2040_i2c_tx.cpp
index 4972415..4014354 100644
--- a/i2c-hub/firmware/i2c-hub-firmware/src/gobotrpc/transmission_interface/rp2040_i2c_tx.cpp
+++ b/i2c-hub/firmware/i2c-hub-firmware/src/gobotrpc/transmission_interface/rp2040_i2c_tx.cpp
@@ -20,7 +20,7 @@ void GobotRPC_TI_Hardware_RP2040_I2C::i2cTxTask() {
unsigned int res = i2c_write_burst_blocking(i2c, pkg.addr & 0x7f, (uint8_t *)(&pkg.data), pkg.len);
xSemaphoreGive(i2cMutex);
- if(res != PICO_ERROR_GENERIC) {
+ if(res == PICO_ERROR_GENERIC) {
raiseTranmissionError(false, pkg.addr);
} else {
raiseTransmissionSuceess(pkg.addr);
diff --git a/i2c-hub/uart-adapter/src/main.py b/i2c-hub/uart-adapter/src/main.py
index a9145a0..8cc23da 100644
--- a/i2c-hub/uart-adapter/src/main.py
+++ b/i2c-hub/uart-adapter/src/main.py
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:e99e114ca77175f7a1e9d08ece842a5f293ca2f12b7486444526b01714e92e8f
-size 895
+oid sha256:d47300d16147ee01b8c8076dfed6cedee0c6565f232daeb3ae8c70e95a4b8b79
+size 893
diff --git a/motor-control/core-xy-firmware/src/corexy/tasks.cpp b/motor-control/core-xy-firmware/src/corexy/tasks.cpp
index 6a0b417..a2b4d6a 100644
--- a/motor-control/core-xy-firmware/src/corexy/tasks.cpp
+++ b/motor-control/core-xy-firmware/src/corexy/tasks.cpp
@@ -9,30 +9,46 @@ void waitForUserInput() {
}
void performGridCall(CoreXYMaschine * machine) {
- MotorPosition p0;
- MotorPosition p1;
- machine->homeFast(&p0, false);
- printf("First Position\n");
- machine->setMotorEnabled(false);
- waitForUserInput();
- machine->setMotorEnabled(true);
- machine->homeFast(&p0, false);
+ while (true) {
+
+ MotorPosition p0 = {.x=1296, .y=1802};
+ MotorPosition p1 = {.x=16696, .y=18722};
- printf("Second Position\n");
- machine->setMotorEnabled(false);
- waitForUserInput();
- machine->setMotorEnabled(true);
- machine->homeFast(&p1, false);
+// machine->homeFast(&p0, false);
+// printf("First Position\n");
+// machine->setMotorEnabled(false);
+// waitForUserInput();
+// machine->setMotorEnabled(true);
+// machine->homeFast(&p0, false);
+//
+// printf("Second Position\n");
+// machine->setMotorEnabled(false);
+// waitForUserInput();
+// machine->setMotorEnabled(true);
+// machine->homeFast(&p1, false);
+//
+// printf("First Position: %d, %d\n", p0.x, p0.y);
+// printf("Second Position: %d, %d\n", p1.x, p1.y);
+//
+ BoardMessurements messurements = calcBoardMessurements(p0, p1, 19, 19);
+ machine->setBoardMessurements(messurements);
+ printf("Hi!\n");
+ machine->home(NULL);
+ waitForUserInput();
+ machine->gotoPosition(10, 9);
+ waitForUserInput();
+ machine->gotoPosition(9, 10);
+ waitForUserInput();
+ machine->gotoPosition(8, 9);
+ waitForUserInput();
+ machine->gotoPosition(9, 8);
+ waitForUserInput();
+ machine->gotoPosition(10, 7);
+ waitForUserInput();
+ machine->home(NULL);
+ }
- printf("First Position: %d, %d\n", p0.x, p0.y);
- printf("Second Position: %d, %d\n", p1.x, p1.y);
-
- BoardMessurements messurements = calcBoardMessurements(p0, p1, 19, 19);
- machine->setBoardMessurements(messurements);
-
- machine->gotoPosition(15, 15);
- vTaskDelay(100 / portTICK_PERIOD_MS);
//machine->gotoPosition(7, 6);
//for(int i = 0; i < 19; i++) {
diff --git a/stone-dispencer-control/firmware-stone-dispencer/src/main.cpp b/stone-dispencer-control/firmware-stone-dispencer/src/main.cpp
index 177a741..8ce2a13 100644
--- a/stone-dispencer-control/firmware-stone-dispencer/src/main.cpp
+++ b/stone-dispencer-control/firmware-stone-dispencer/src/main.cpp
@@ -14,15 +14,26 @@ void vMainTask(void *pvParameters) {
bool buttonLastState = false;
headSystem->setHeadUp(true);
+
+ unsigned int counter = 0;
while (1) {
buttonState = !gpio_get(BUTTON_PIN);
- if(buttonState) {
+ if(buttonState && counter == 4) {
+ headSystem->setHeadUp(false);
+ } else if(buttonState && counter == 5) {
+ headSystem->setHeadUp(true);
+ } else if(buttonState) {
STONE_STATE s = headSystem->dropSequence();
printf("Stone dropped: %d\n", s);
}
+ if(buttonState) {
+ printf("Counter: %d\n", counter);
+ counter = (counter + 1) % 6;
+ }
+
buttonLastState = buttonState;
vTaskDelay(pdMS_TO_TICKS(100));
}