Quantcast
Channel: Arduino Forum - Latest topics
Viewing all articles
Browse latest Browse all 15374

Cannot perform port reset: TOUCH: error during reset: opening port at 1200bps: Invalid serial port UNO R4

$
0
0

I'm new to using the UNO R4, I started using it with a load cell and the Arduino IDE 2.2.1 and tryed to connect it to the ioT Cloud. While I was using it in the IDE it all went correctly, but when I started with the Cloud the board woult be marked as offline and the code wouldn´t upload; I started investigating and this site helped me:

Later the board would not get recognized again in the cloud but it marked that it needed a firmware update but it couldn´t update it automatically with the cloud, I tried to update it with the IDE using this link:

With the IDE option it also would not update as it said that the update could not be installed

After that I tried running the espflash directly as it said in the second link I added, it didn't work either.
Then I tried using the updater script as the same link also said, it didn't work aither and showed this:

I also tried uninstalling the COM port as the board always get detected in the COM5 port even after pressing and releasing twice quickly the reset button.

Right now if I gave up on trying to use the Cloud and even in the IDE when I try to upload any code it shows this error always:

This is the code I was using:

#include <HID.h>
#include "HX711.h"

const int DOUT=A1;
const int CLK=A0;

float calibrating;
const float realWeight = 0.180;
float sum_calibrating;
float REAL_calibrating;

HX711 scale;
void setup() {
  Serial.begin(9600);
  scale.begin(DOUT, CLK);
  sum_calibrating = 0;
  Serial.print("Lectura del valor del ADC:t");
  Serial.println(scale.read());
  Serial.println("No ponga ningún objeto sobre la scale");
  Serial.println("Destarando...");
  scale.set_scale(); //La escala por defecto es 1
  scale.tare(20);  //El peso actual es considerado Tara.
  Serial.println("Coloque un peso conocido:");
}

void loop() {
 if(Serial.available()){
    char activate = Serial.read();
    if(activate == 'a'){
      CalibrationFactor();
      Serial.println("DONE WITH CALIBRATION FACTOR");
    }
    else{
      Serial.println("Waiting for weight");
      delay(1000);
    }
  }

  
}

void CalibrationFactor(){
  for (int i=0; i<=10; i++){
    //Read the weight cell
    Serial.print("Valor de lectura: t");
    Serial.print(scale.get_value(10),0);
    //Get Calibration Factor
    calibrating = (scale.read())/realWeight;
    Serial.print(" Calibration Factor: ");
    Serial.print(calibrating);

    //Get REAL Calibration Factor
    sum_calibrating = sum_calibrating + calibrating;
    REAL_calibrating = sum_calibrating/i;
  
    Serial.print(" REAL Calibration Factor: ");
    Serial.println(REAL_calibrating);
    delay(100);
  }
}

Does anyone know how to fix this?

Thanks in advance

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 15374

Trending Articles