From 01f1a361963add2872bf941f2074d0547a083025 Mon Sep 17 00:00:00 2001 From: Fisch Date: Sun, 12 Apr 2020 15:03:37 +0200 Subject: [PATCH] remove old code comments --- .../mixercontroller_w5100_pio/src/main.cpp | 154 +----------------- 1 file changed, 2 insertions(+), 152 deletions(-) diff --git a/controller/mixercontroller_w5100_pio/src/main.cpp b/controller/mixercontroller_w5100_pio/src/main.cpp index bc4928d..f9407e3 100644 --- a/controller/mixercontroller_w5100_pio/src/main.cpp +++ b/controller/mixercontroller_w5100_pio/src/main.cpp @@ -19,7 +19,6 @@ uint32_t Wheel(byte WheelPos); boolean srRead(uint8_t pbit); void srWrite(uint8_t pbit, boolean state); void callback(char* topic, byte* payload, unsigned int length); -void sendData(); void srShiftOut(); void setMuteInt(uint8_t i); void setSelectionInt(uint8_t i); @@ -302,66 +301,7 @@ void loop() { } - //Motor Movement Routine ################# - /* - if (error==0){ //no errors - - if (!poti_reachedposition && abs(poti_read-poti_set)>DEADZONE_POTI){ //difference too high - if (poti_read-poti_set < 0){ - MOTOR_LEFT(); - }else{ - MOTOR_RIGHT(); - } - }else if(!poti_reachedposition){ //position reached but flag not set - MOTOR_STOP(); - Serial.print("reached:"); - Serial.print(" set="); - Serial.print(poti_set); - Serial.print(" is="); - Serial.print(poti_read); - Serial.print(" vel="); - Serial.println(); - poti_reachedposition=true; //position reached - } - - - if ( loopmillis > last_motorcheck+INTERVAL_MOTORCHECK){ - last_motorcheck=loopmillis; - - motor_vel=(poti_read-poti_read_last)*1000 /INTERVAL_MOTORCHECK ; //calculate current motor velocity - poti_read_last=poti_read; - - //motor fail check - if (MOTOR_TURNING() && abs(motor_vel) MOTOR_FAILTIME){ - error=MOTORDIDNOTTURN; - Serial.println("MOTORDIDNOTTURN"); - } - - }else if (last_motorTooSlow>0){ //was recognized too slow but is now turning fast again - last_motorTooSlow=0; //reset - } - - } - }else{ //an error occured. error!=0 - MOTOR_STOP(); - } - */ - - //Test - /*if (poti_set == 512){ - MOTOR_STOP(); - }else if (poti_set < 512){ - motorspeed=(512-poti_set)/2; - MOTOR_LEFT_PWM(); - }else if (poti_set > 512){ - motorspeed=(poti_set-512)/2; - MOTOR_RIGHT_PWM(); - }*/ - - + //Motor Movement Routine ################# if (!motorerror) //motor not stuck etc { @@ -448,20 +388,6 @@ void loop() { } -void sendData() { - char msgBuffer[20]; - float h = 50; - float testvalue = 42; - /* - Serial.print("testvalue: "); - Serial.print(testvalue); - Serial.println(); - - if (mqttClient.connect(CLIENT_ID)) { - mqttClient.publish("audiomixer/messwert/parameter", dtostrf(testvalue, 6, 2, msgBuffer)); - //mqttClient.publish(DEVICENAME+"/br/nb/deur", (statusBD == HIGH) ? "OPEN" : "CLOSED"); - }*/ -} void callback(char* topic, byte* payload, unsigned int length) { payload[length] = '\0'; //add end of string character @@ -474,11 +400,6 @@ void callback(char* topic, byte* payload, unsigned int length) { Serial.println(); - - //if (strncmp((const char*)payload, "ON", 2) == 0) { - //} - - //if (strncmp((const char*)topic, "audiomixer/volume/set",sizeof(topic)) == 0) { if (String(topic).equals("audiomixer/volume/set")){ @@ -501,18 +422,7 @@ void callback(char* topic, byte* payload, unsigned int length) { }else if (ipayload>=0 && ipayload<((uint16_t)1<